pw_toolchain_extra: Add experimental GN toolchain API
Change-Id: Id9b304626a901395e81410733e035c492a85dfd4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/experimental/+/178117
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
diff --git a/modules.gni b/modules.gni
index 4d95dc8..3e0c923 100644
--- a/modules.gni
+++ b/modules.gni
@@ -77,6 +77,7 @@
get_path_info("pw_spin_delay_stm32f769i_disc0", "abspath")
dir_pw_sys_io_baremetal_stm32f769 =
get_path_info("pw_sys_io_baremetal_stm32f769", "abspath")
+ dir_pw_toolchain_extra = get_path_info("pw_toolchain_extra", "abspath")
dir_pw_pixel_pusher = get_path_info("pw_pixel_pusher", "abspath")
dir_pw_pixel_pusher_rp2040_pio =
get_path_info("pw_pixel_pusher_rp2040_pio", "abspath")
diff --git a/pw_toolchain_extra/README.md b/pw_toolchain_extra/README.md
new file mode 100644
index 0000000..9f53481
--- /dev/null
+++ b/pw_toolchain_extra/README.md
@@ -0,0 +1,33 @@
+# pw_toolchain_extra
+
+[TOC]
+
+## Overview
+This module provides experimental toolchain-related features. Some of these may
+make their way into Pigweed, some are illustrative examples.
+
+## GN pw_toolchain and pw_cortex_m_gcc_toolchain templates
+These templates imagine a slightly different API for instantiating toolchains.
+Rather than toolchains being pre-defined scopes that you can import and extend
+or override, `pw_cortex_m_gcc_toolchain` illustrates a configurable toolchain
+that puts more control into the hands of the user while also being more legible
+at-a-glance.
+
+`pw_cortex_m_gcc_toolchain` is built on top of `pw_toolchain`. The naming of the
+`pw_toolchain` template is intentionally similar to `generate_toolchain`, and
+this is for two reasons:
+
+1. `generate_toolchain` should have been named `pw_generate_toolchain` from the
+ Beginning. Namespacing templates behind `pw_*` is a well-established pattern
+ that unfortunately wasn't applied to the `generate_toolchain` template during
+ its inception. `pw_toolchain` takes the verb out of the name, and prefixes
+ with `pw_*` to match the established naming patterns.
+2. `pw_toolchain` extends upon and improves `generate_toolchain` with the intent
+ to eventually replace it. This naming difference provides a migration path.
+
+The `pw_toolchain` template also makes it easier to stand up RBE for a given
+toolchain by parameterizing the required flags.
+
+As the GN build will likely be turned down in the distant future, it's unlikely
+these templates will make their way into the core Pigweed repository. It's left
+here as a proof-of-concept for the direction Pigweed might have gone
diff --git a/pw_toolchain_extra/cortex_m/BUILD.gn b/pw_toolchain_extra/cortex_m/BUILD.gn
new file mode 100644
index 0000000..68676a2
--- /dev/null
+++ b/pw_toolchain_extra/cortex_m/BUILD.gn
@@ -0,0 +1,202 @@
+# Copyright 2023 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+import("//build_overrides/pigweed_environment.gni")
+
+import("$dir_pw_build/target_types.gni")
+
+# Disable obnoxious ABI warning.
+#
+# GCC 7.1 adds an over-zealous ABI warning with little useful information
+# on how to resolve the issue. The warning you get is:
+#
+# note: parameter passing for argument of type '...' changed in GCC 7.1
+#
+# There is no other information, and searching for the error is needed to
+# understand what is happening. For upstream Pigweed, we compile from
+# source so this is irrelevant; so disable it.
+#
+# See: https://gcc.gnu.org/gcc-7/changes.html (search for "psabi").
+# https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
+config("disable_psabi_warning") {
+ cflags = [ "-Wno-psabi" ]
+}
+
+config("thumb") {
+ asmflags = [
+ "-mabi=aapcs",
+ "-mthumb",
+ ]
+ cflags = asmflags
+ ldflags = cflags
+}
+
+config("newlib_nano") {
+ cflags = [
+ "--sysroot=" + rebase_path(pw_env_setup_CIPD_ARM, root_build_dir),
+ "-specs=nano.specs",
+ ]
+ ldflags = cflags + [ "-lc" ]
+}
+
+config("nosys") {
+ cflags = [ "-specs=nosys.specs" ]
+ ldflags = cflags + [ "-lnosys" ]
+}
+
+config("enable_float_printf") {
+ cflags = [ "-u_printf_float" ]
+ ldflags = cflags
+}
+
+config("cortex_m0") {
+ cflags = [ "-mcpu=cortex-m0" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m0_small_multiply") {
+ cflags = [ "-mcpu=cortex-m0.small-multiply" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m0plus") {
+ cflags = [ "-mcpu=cortex-m0plus" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m0plus_small_multiply") {
+ cflags = [ "-mcpu=cortex-m0plus.small-multiply" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m1") {
+ cflags = [ "-mcpu=cortex-m1" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m1_small_multiply") {
+ cflags = [ "-mcpu=cortex-m1.small-multiply" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m3") {
+ cflags = [ "-mcpu=cortex-m3" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m4") {
+ cflags = [ "-mcpu=cortex-m4" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m7") {
+ cflags = [ "-mcpu=cortex-m7" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m23") {
+ cflags = [ "-mcpu=cortex-m23" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m33") {
+ cflags = [ "-mcpu=cortex-m33" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m35p") {
+ cflags = [ "-mcpu=cortex-m35p" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("cortex_m55") {
+ cflags = [ "-mcpu=cortex-m33" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("fpu_soft") {
+ cflags = [ "-mfloat-abi=soft" ]
+ asmflags = cflags
+ ldflags = cflags
+}
+
+config("fpu_fpv4_sp") {
+ cflags = [
+ "-mfloat-abi=hard",
+ "-mfpu=fpv4-sp-d16",
+ ]
+ asmflags = cflags
+ defines = [ "PW_ARMV7M_ENABLE_FPU=1" ]
+ ldflags = cflags
+}
+
+config("fpu_fpv5") {
+ cflags = [
+ "-mfloat-abi=hard",
+ "-mfpu=fpv5-d16",
+ ]
+ asmflags = cflags
+ defines = [ "PW_ARMV7M_ENABLE_FPU=1" ]
+ ldflags = cflags
+}
+
+config("fpu_fpv5_sp") {
+ cflags = [
+ "-mfloat-abi=hard",
+ "-mfpu=fpv5-sp-d16",
+ ]
+ asmflags = cflags
+ defines = [ "PW_ARMV7M_ENABLE_FPU=1" ]
+ ldflags = cflags
+}
+
+config("wrap_newlib_stdio_functions") {
+ ldflags = [
+ "-Wl,--wrap=__sread",
+ "-Wl,--wrap=__swrite",
+ "-Wl,--wrap=__sseek",
+ "-Wl,--wrap=__sclose",
+ ]
+ visibility = [ ":*" ]
+}
+
+pw_source_set("newlib_os_interface_stubs") {
+ all_dependent_configs = [ ":wrap_newlib_stdio_functions" ]
+ sources = [ "$dir_pw_toolchain/arm_gcc/newlib_os_interface_stubs.cc" ]
+ deps = [ dir_pw_assert ]
+ visibility = [ ":*" ]
+}
+
+# Basic libraries any arm-none-eabi-gcc target should use. This library should
+# be included in pw_build_LINK_DEPS.
+group("arm_none_eabi_gcc_support") {
+ deps = [
+ ":newlib_os_interface_stubs",
+ "$dir_pw_toolchain:wrap_abort",
+ ]
+}
diff --git a/pw_toolchain_extra/cortex_m/gcc_toolchain.gni b/pw_toolchain_extra/cortex_m/gcc_toolchain.gni
new file mode 100644
index 0000000..95bc9c3
--- /dev/null
+++ b/pw_toolchain_extra/cortex_m/gcc_toolchain.gni
@@ -0,0 +1,118 @@
+# Copyright 2023 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+import("//build_overrides/pigweed_environment.gni")
+
+import("$dir_pw_build/defaults.gni")
+import("$dir_pw_toolchain/rbe.gni")
+import("$dir_pw_toolchain_extra/generate_toolchain.gni")
+
+pw_toolchain_CORTEX_M_CPU = {
+ M0 = "m0"
+ M0_SMALL_MULTIPLY = "m0_small_multiply"
+ M0PLUS = "m0plus"
+ M0PLUS_SMALL_MULTIPLY = "m0plus_small_multiply"
+ M1 = "m1"
+ M1_SMALL_MULTIPLY = "m1_small_multiply"
+ M3 = "m3"
+ M4 = "m4"
+ M7 = "m7"
+ M23 = "m23"
+ M33 = "m33"
+ M35P = "m35p"
+ M55 = "m55"
+}
+
+pw_toolchain_CORTEX_M_FPU = {
+ SOFTWARE = "soft"
+ FPV4_SP = "fpv4_sp"
+ FP_V5 = "fpv5"
+ FP_V5_SP = "fpv5_sp"
+}
+
+declare_args() {
+ pw_toolchain_ARM_NONE_EABI_ROOT =
+ rebase_path(pw_env_setup_CIPD_ARM + "/bin/", root_build_dir)
+}
+
+# In addition to all the arguments supported by pw_toolchain, this template
+# adds the following arguments:
+# cpu (required): Which Cortex-M CPU to build for.
+# fpu (optional): Which Cortex-M FPU architecture to build for. Defaults to
+# emulated (software) FPU.
+# use_newlib_nano (optional): Whether or not to use newlib-nano. Defaults to
+# true.
+# use_nosys (optional): Whether or not to use nosys implementation stubs for
+# syscalls. Defaults to true.
+template("pw_cortex_m_gcc_toolchain") {
+ pw_toolchain(target_name) {
+ _tool_prefix = "arm-none-eabi-"
+ _toolchain_root = pw_toolchain_ARM_NONE_EABI_ROOT
+
+ cc = _toolchain_root + _tool_prefix + "gcc"
+ cxx = _toolchain_root + _tool_prefix + "g++"
+ ar = _toolchain_root + _tool_prefix + "ar"
+ ld = _toolchain_root + _tool_prefix + "g++"
+
+ rbe_config = pw_rbe_arm_gcc_config
+ rbe_input_dir = _toolchain_root
+
+ # Default to enabling link_whole_archive for Cortex-M builds.
+ if (!defined(invoker.link_whole_archive)) {
+ link_whole_archive = true
+ }
+
+ # TODO(amontanez): Add check for supported options. Also CPU.
+ if (defined(invoker.fpu)) {
+ _fpu = invoker.fpu
+ } else {
+ _fpu = pw_toolchain_CORTEX_M_FPU.SOFTWARE
+ }
+
+ default_configs = [
+ "$dir_pw_toolchain_extra/cortex_m:disable_psabi_warning",
+ "$dir_pw_toolchain_extra/cortex_m:thumb",
+ "$dir_pw_toolchain_extra/cortex_m:cortex_${invoker.cpu}",
+ "$dir_pw_toolchain_extra/cortex_m:fpu_${_fpu}",
+ ]
+ default_configs += pigweed_default_configs
+
+ if (!defined(invoker.use_newlib_nano) || invoker.use_newlib_nano) {
+ default_configs += [ "$dir_pw_toolchain_extra/cortex_m:newlib_nano" ]
+ }
+ if (!defined(invoker.use_nosys) || invoker.use_nosys) {
+ default_configs += [ "$dir_pw_toolchain_extra/cortex_m:nosys" ]
+ }
+
+ if (defined(invoker.default_configs)) {
+ default_configs += invoker.default_configs
+ }
+
+ if (!defined(invoker.current_cpu)) {
+ current_cpu = "arm"
+ }
+
+ # Arguments that are consumed by this template and shouldn't be directly
+ # forwarded to the underlying template.
+ _args_used = [
+ "cpu",
+ "fpu",
+ "use_newlib_nano",
+ "use_nosys",
+ "default_configs",
+ ]
+ forward_variables_from(invoker, "*", _args_used)
+ }
+}
diff --git a/pw_toolchain_extra/generate_toolchain.gni b/pw_toolchain_extra/generate_toolchain.gni
new file mode 100644
index 0000000..ccc94e8
--- /dev/null
+++ b/pw_toolchain_extra/generate_toolchain.gni
@@ -0,0 +1,152 @@
+# Copyright 2023 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_toolchain/generate_toolchain.gni")
+import("$dir_pw_toolchain/rbe.gni")
+import("$dir_pw_toolchain/static_analysis_toolchain.gni")
+import("$dir_pw_toolchain/universal_tools.gni")
+
+# A Pigweed target toolchain.
+#
+# Args:
+# ar: (required) String indicating the archive tool to use.
+# cc: (required) String indicating the C compiler to use.
+# cxx: (required) String indicating the C++ compiler to use.
+# ld: (optional) String indicating the linking binary to use.
+# is_host_toolchain: (optional) Boolean indicating if the outputs are meant
+# for the $host_os. Defaults to false.
+# final_binary_extension: (optional) The extension to apply to final linked
+# binaries.
+# link_whole_archive: (optional) Boolean indicating if the linker should load
+# all object files when resolving symbols.
+# link_group: (optional) Boolean indicating if the linker should use
+# a group to resolve circular dependencies between artifacts.
+# generate_from: (optional) The full target name of the toolchain that can
+# trigger this toolchain to be generated. GN only allows one toolchain to
+# be generated at a given target path, so if multiple toolchains parse the
+# same generate_toolchain target only one should declare a toolchain. This
+# is primarily to allow generating sub-toolchains. Defaults to
+# default_toolchain.
+# default_configs (optional): TODO
+# remove_default_configs (optional): TODO
+# default_public_deps (optional): TODO
+# toolchain_args: (required) A scope setting GN build arg values to use when
+# evaluating the build graph with this toolchain. These take precedence
+# over user-specified values (whether via the command line or in the
+# args.gn file).
+# rbe_config (optional): TODO
+# rbe_input_dir (optional): TODO
+#
+# The defaults scope should contain values for builtin GN arguments:
+# current_cpu: The CPU of the toolchain.
+# Well known values include "arm", "arm64", "x64", "x86", and "mips".
+# current_os: The OS of the toolchain. Defaults to "".
+# Well known values include "win", "mac", "linux", "android", and "ios".
+template("pw_toolchain") {
+ # On the default toolchain invocation, you typically need to generate all
+ # toolchains you encounter. For sub-toolchains, they must be generated from
+ # the context of their parent.
+ #
+ # This is duplicated from `generate_toolchain` because of GN evaluation
+ # behavior. Ideally pw_toolchain is merged into `generate_toolchain`,
+ # eliminating the need for this to be duplicated.
+ if (defined(invoker.generate_from)) {
+ _generate_toolchain =
+ get_label_info(invoker.generate_from, "label_no_toolchain") ==
+ current_toolchain
+ } else {
+ _generate_toolchain = default_toolchain == current_toolchain
+ }
+
+ if (_generate_toolchain) {
+ generate_toolchain(target_name) {
+ # All of the RBE support logic is housed here.
+ if (pw_toolchain_USE_RBE && defined(invoker.rbe_config)) {
+ # It might make sense to expose these as optional arguments later.
+ _rewrapper_binary = "rewrapper"
+ _exec_root = rebase_path("//")
+
+ _rbe_args = [
+ _rewrapper_binary,
+ "--labels=type=compile,lang=cpp,compiler=clang",
+ "--cfg=" + invoker.rbe_config,
+ "--exec_root=" + _exec_root,
+ ]
+
+ if (defined(rbe_input_dir)) {
+ _rbe_args += [ "--inputs=" +
+ rebase_path(invoker.rbe_input_dir, _exec_root) + "/" ]
+ }
+
+ _rbe_args += [ "--" ]
+
+ _rbe_toolchain_prefix = string_join(" ", _rbe_args)
+
+ # Assemble the final command.
+ _cc_cmd = _rbe_args + [ cc ]
+ _cxx_cmd = _rbe_args + [ cxx ]
+ if (pw_toolchain_RBE_DEBUG) {
+ _rbe_debug_flag = "-v"
+ _cc_cmd += [ _rbe_debug_flag ]
+ _cxx_cmd += [ _rbe_debug_flag ]
+ }
+
+ cc = string_join(" ", _cc_cmd)
+ cxx = string_join(" ", _cxx_cmd)
+ }
+
+ # This is still called `defaults` for backwards compatibility.
+ defaults = {
+ forward_variables_from(invoker.toolchain_args, "*")
+ if (defined(default_configs)) {
+ _this = get_label_info(target_name, "label_with_toolchain")
+ print("$default_configs when evaluating $_this")
+ }
+
+ if (defined(invoker.default_configs)) {
+ default_configs = invoker.default_configs
+ }
+ if (defined(invoker.remove_default_configs)) {
+ remove_default_configs = invoker.remove_default_configs
+ }
+ if (defined(invoker.default_public_deps)) {
+ default_public_deps = invoker.default_public_deps
+ }
+ if (defined(invoker.remove_default_public_deps)) {
+ remove_default_public_deps = invoker.remove_default_public_deps
+ }
+ }
+
+ assert(!defined(invoker.defaults),
+ "`defaults` is the old way, use toolchain_args")
+
+ # Arguments that are consumed by this template and shouldn't be directly
+ # forwarded to the underlying template.
+ _args_used = [
+ "toolchain_args",
+ "default_configs",
+ "remove_default_configs",
+ "default_public_deps",
+ "remove_default_public_deps",
+ ]
+ forward_variables_from(invoker, "*", _args_used)
+ }
+ } else {
+ not_needed(invoker, "*")
+ group(target_name) {
+ }
+ }
+}
diff --git a/targets/stm32f429i_disc1/BUILD.gn b/targets/stm32f429i_disc1/BUILD.gn
index 200c021..f04d774 100644
--- a/targets/stm32f429i_disc1/BUILD.gn
+++ b/targets/stm32f429i_disc1/BUILD.gn
@@ -14,9 +14,50 @@
import("//build_overrides/pigweed.gni")
-import("$dir_pw_toolchain/generate_toolchain.gni")
-import("target_toolchains.gni")
+import("$dir_pigweed/targets/stm32f429i_disc1/target_toolchains.gni")
+import("$dir_pigweed_experimental/targets/common_backends.gni")
+import("$dir_pw_toolchain_extra/cortex_m/gcc_toolchain.gni")
-generate_toolchains("toolchains") {
- toolchains = toolchains_list
+_toolchain_base = pw_target_toolchain_stm32f429i_disc1.debug
+_excluded_defaults = [
+ "pw_cpu_exception_ENTRY_BACKEND",
+ "pw_cpu_exception_HANDLER_BACKEND",
+ "pw_cpu_exception_SUPPORT_BACKEND",
+ "default_configs",
+]
+
+pw_cortex_m_gcc_toolchain("stm32f429i_disc1_debug") {
+ cpu = pw_toolchain_CORTEX_M_CPU.M4
+ fpu = pw_toolchain_CORTEX_M_FPU.FPV4_SP
+ final_binary_extension = ".elf"
+ default_configs = [
+ "$dir_pw_build:extra_strict_warnings",
+ "$dir_pw_toolchain/arm_gcc:enable_float_printf",
+ "$dir_pw_build:optimize_debugging",
+ ]
+ toolchain_args = {
+ forward_variables_from(_toolchain_base.defaults, "*", _excluded_defaults)
+ app_common_BACKEND =
+ "$dir_pigweed_experimental/applications/app_common_impl:stm32"
+ pw_board_led_BACKEND = "$dir_pw_board_led_stm32f429i_disc1"
+ pw_spin_delay_BACKEND = "$dir_pw_spin_delay_stm32f429i_disc1"
+ }
+}
+
+pw_cortex_m_gcc_toolchain("stm32f429i_disc1_debug_tests") {
+ cpu = pw_toolchain_CORTEX_M_CPU.M4
+ fpu = pw_toolchain_CORTEX_M_FPU.FPV4_SP
+ final_binary_extension = ".elf"
+ default_configs = [
+ "$dir_pw_build:extra_strict_warnings",
+ "$dir_pw_toolchain/arm_gcc:enable_float_printf",
+ "$dir_pw_build:optimize_size",
+ ]
+ toolchain_args = {
+ forward_variables_from(_toolchain_base.defaults, "*", _excluded_defaults)
+
+ # Force tests to use basic log backend to avoid generating and loading its
+ # own tokenized database.
+ pw_log_BACKEND = dir_pw_log_basic
+ }
}
diff --git a/targets/stm32f429i_disc1/target_toolchains.gni b/targets/stm32f429i_disc1/target_toolchains.gni
deleted file mode 100644
index 183f00f..0000000
--- a/targets/stm32f429i_disc1/target_toolchains.gni
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 2021 The Pigweed Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-import("//build_overrides/pigweed.gni")
-
-import("$dir_pigweed/targets/stm32f429i_disc1/target_toolchains.gni")
-import("$dir_pigweed_experimental/targets/common_backends.gni")
-import("$dir_pw_protobuf_compiler/proto.gni")
-import("$dir_pw_third_party/nanopb/nanopb.gni")
-
-target_toolchain_stm32f429i_disc1 = {
- _excluded_members = [
- "defaults",
- "name",
- ]
- _excluded_defaults = [
- "pw_cpu_exception_ENTRY_BACKEND",
- "pw_cpu_exception_HANDLER_BACKEND",
- "pw_cpu_exception_SUPPORT_BACKEND",
- ]
-
- debug = {
- name = "stm32f429i_disc1_debug"
- _toolchain_base = pw_target_toolchain_stm32f429i_disc1.debug
- forward_variables_from(_toolchain_base, "*", _excluded_members)
- defaults = {
- forward_variables_from(_toolchain_base.defaults, "*", _excluded_defaults)
- forward_variables_from(toolchain_overrides, "*")
- app_common_BACKEND =
- "$dir_pigweed_experimental/applications/app_common_impl:stm32"
- pw_board_led_BACKEND = "$dir_pw_board_led_stm32f429i_disc1"
- pw_spin_delay_BACKEND = "$dir_pw_spin_delay_stm32f429i_disc1"
- }
- }
-
- # Toolchain for tests only.
- debug_tests = {
- name = "stm32f429i_disc1_debug_tests"
- _toolchain_base = pw_target_toolchain_stm32f429i_disc1.debug
- forward_variables_from(_toolchain_base, "*", _excluded_members)
- defaults = {
- forward_variables_from(_toolchain_base.defaults, "*", _excluded_defaults)
- forward_variables_from(toolchain_overrides, "*")
-
- # Force tests to use basic log backend to avoid generating and loading its
- # own tokenized database.
- pw_log_BACKEND = dir_pw_log_basic
- }
- }
-}
-
-toolchains_list = [
- target_toolchain_stm32f429i_disc1.debug,
- target_toolchain_stm32f429i_disc1.debug_tests,
-]