From 4f14d74071549bc9ef233d491de5e177d8260bce Mon Sep 17 00:00:00 2001 From: Armando Montanez Date: Mon, 16 Dec 2024 12:37:59 -0800 Subject: [PATCH] pw_toolchain_bazel: Move CPU constraints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pw_toolchain_bazel has been migrated to rules_cc, so the implementation in Pigweed is being removed. This moves Pigweed's ARM mcpu constraints into the main Pigweed repository so pw_toolchain_bazel can be removed. Bug: b/346388161 Change-Id: Ic85f8502671d8388fd8f01c0d3567f2433a9a8bc Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/252314 Docs-Not-Needed: Armando Montanez Commit-Queue: Auto-Submit Reviewed-by: Ted Pudlik Lint: Lint 🤖 Pigweed-Auto-Submit: Armando Montanez Presubmit-Verified: CQ Bot Account --- pw_build/constraints/arm/BUILD.bazel | 94 +++++++++++++++++++ .../constraints/{cortex_m => arm}/lists.bzl | 0 pw_build/constraints/cortex_m/BUILD.bazel | 15 --- pw_build/platforms/BUILD.bazel | 4 +- pw_toolchain/BUILD.bazel | 8 +- pw_toolchain/arm_clang/BUILD.bazel | 26 ++--- pw_toolchain/arm_gcc/BUILD.bazel | 52 +++++----- pw_toolchain/build_external/llvm_clang.BUILD | 2 +- pw_toolchain_bazel/MODULE.bazel | 5 + .../constraints/arm_mcpu/BUILD.bazel | 72 ++++++-------- targets/rp2040/BUILD.bazel | 4 +- targets/stm32f429i_disc1/BUILD.bazel | 2 +- .../stm32f429i_disc1_stm32cube/BUILD.bazel | 2 +- 13 files changed, 179 insertions(+), 107 deletions(-) create mode 100644 pw_build/constraints/arm/BUILD.bazel rename pw_build/constraints/{cortex_m => arm}/lists.bzl (100%) delete mode 100644 pw_build/constraints/cortex_m/BUILD.bazel diff --git a/pw_build/constraints/arm/BUILD.bazel b/pw_build/constraints/arm/BUILD.bazel new file mode 100644 index 0000000000..51942ebe87 --- /dev/null +++ b/pw_build/constraints/arm/BUILD.bazel @@ -0,0 +1,94 @@ +# Copyright 2024 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. + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +# The target Arm processor. +# +# The values of this constraint_setting correspond to valid values of the -mcpu +# compiler flag. See +# https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-mcpu-2. These +# values are intended to be used in `target_compatible_with` attributes of +# toolchains which specify the corresponding value of -mcpu. +# +# The constraint_values are not currently exhaustively enumerated (only a few +# of the legal -mcpu values have corresponding constraint_values). The intent +# is for additional values to be added when needed. +# +# The intent is to support only the base processor type, not -march +# values (e.g., armv7e-m). This is because it is recommended to use (processor +# type + optional architectural extensions) when configuring Arm GCC (see +# https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu). +# In addition, the march values can already be captured using @platforms//cpu. +# +# Additionally, extensions should be represented via separate constraints to +# prevent the explosion of many variants. +constraint_setting( + name = "mcpu", + default_constraint_value = "none", +) + +constraint_value( + name = "none", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-a32", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m0", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m0plus", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m3", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m4", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m4+nofp", + constraint_setting = ":mcpu", + deprecation = "FPU properties should be expressed with different constraints", +) + +constraint_value( + name = "cortex-m7", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m33", + constraint_setting = ":mcpu", +) + +constraint_value( + name = "cortex-m33+nofp", + constraint_setting = ":mcpu", + deprecation = "FPU properties should be expressed with different constraints", +) diff --git a/pw_build/constraints/cortex_m/lists.bzl b/pw_build/constraints/arm/lists.bzl similarity index 100% rename from pw_build/constraints/cortex_m/lists.bzl rename to pw_build/constraints/arm/lists.bzl diff --git a/pw_build/constraints/cortex_m/BUILD.bazel b/pw_build/constraints/cortex_m/BUILD.bazel deleted file mode 100644 index 443fbb62f7..0000000000 --- a/pw_build/constraints/cortex_m/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2024 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. - -package(default_visibility = ["//visibility:public"]) diff --git a/pw_build/platforms/BUILD.bazel b/pw_build/platforms/BUILD.bazel index e9540928f0..41db6d2946 100644 --- a/pw_build/platforms/BUILD.bazel +++ b/pw_build/platforms/BUILD.bazel @@ -50,7 +50,7 @@ platform( platform( name = "lm3s6965evb", constraint_values = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m3", + "//pw_build/constraints/arm:cortex-m3", "//pw_build/constraints/chipset:lm3s6965evb", "@platforms//cpu:armv7-m", "@platforms//os:none", @@ -65,7 +65,7 @@ platform( platform( name = "nrf52833", constraint_values = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0", + "//pw_build/constraints/arm:cortex-m0", "//pw_build/constraints/chipset:nrf52833", "@platforms//cpu:armv6-m", "@platforms//os:none", diff --git a/pw_toolchain/BUILD.bazel b/pw_toolchain/BUILD.bazel index 09bfa799e8..77330c9e32 100644 --- a/pw_toolchain/BUILD.bazel +++ b/pw_toolchain/BUILD.bazel @@ -49,7 +49,7 @@ alias( toolchain( name = "cc_toolchain_cortex-m0", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0", + "//pw_build/constraints/arm:cortex-m0", ], toolchain = ":cortex-m_cc_toolchain", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -58,7 +58,7 @@ toolchain( toolchain( name = "cc_toolchain_cortex-m0plus", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus", + "//pw_build/constraints/arm:cortex-m0plus", ], toolchain = ":cortex-m_cc_toolchain", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -67,7 +67,7 @@ toolchain( toolchain( name = "cc_toolchain_cortex-m33", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m33", + "//pw_build/constraints/arm:cortex-m33", ], toolchain = ":cortex-m_cc_toolchain", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -76,7 +76,7 @@ toolchain( toolchain( name = "cc_toolchain_cortex-m3", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m3", + "//pw_build/constraints/arm:cortex-m3", ], toolchain = ":cortex-m_cc_toolchain", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", diff --git a/pw_toolchain/arm_clang/BUILD.bazel b/pw_toolchain/arm_clang/BUILD.bazel index fbb4d3c034..eeecffe59e 100644 --- a/pw_toolchain/arm_clang/BUILD.bazel +++ b/pw_toolchain/arm_clang/BUILD.bazel @@ -197,23 +197,23 @@ cc_toolchain( "//pw_toolchain/cc/args:common_warnings", "//pw_toolchain/cc/args:color_diagnostics", ] + select({ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0": [ + "//pw_build/constraints/arm:cortex-m0": [ ":cortex-m0", ":armv6m-none-eabi", ], - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus": [ + "//pw_build/constraints/arm:cortex-m0plus": [ ":cortex-m0plus", ":armv6m-none-eabi", ], - "@pw_toolchain//constraints/arm_mcpu:cortex-m3": [ + "//pw_build/constraints/arm:cortex-m3": [ ":cortex-m3", ":armv7m-none-eabi", ], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33": [ + "//pw_build/constraints/arm:cortex-m33": [ ":cortex-m33", ":armv8m.main-none-eabi", ], - "@pw_toolchain//constraints/arm_mcpu:none": [], + "//pw_build/constraints/arm:none": [], }), enabled_features = [ "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features", @@ -228,11 +228,11 @@ cc_toolchain( }), tags = ["manual"], # Don't try to build this in wildcard builds. target_compatible_with = select({ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m3": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33": [], - "@pw_toolchain//constraints/arm_mcpu:none": ["@platforms//:incompatible"], + "//pw_build/constraints/arm:cortex-m0": [], + "//pw_build/constraints/arm:cortex-m0plus": [], + "//pw_build/constraints/arm:cortex-m3": [], + "//pw_build/constraints/arm:cortex-m33": [], + "//pw_build/constraints/arm:none": ["@platforms//:incompatible"], }), tool_map = "@llvm_toolchain_device//:all_tools", visibility = ["//pw_toolchain:__pkg__"], @@ -241,7 +241,7 @@ cc_toolchain( toolchain( name = "arm_clang_cc_toolchain_cortex-m0", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0", + "//pw_build/constraints/arm:cortex-m0", ], toolchain = ":arm_clang_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -250,7 +250,7 @@ toolchain( toolchain( name = "arm_clang_cc_toolchain_cortex-m0plus", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus", + "//pw_build/constraints/arm:cortex-m0plus", ], toolchain = ":arm_clang_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -259,7 +259,7 @@ toolchain( toolchain( name = "arm_clang_cc_toolchain_cortex-m33", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m33", + "//pw_build/constraints/arm:cortex-m33", ], toolchain = ":arm_clang_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", diff --git a/pw_toolchain/arm_gcc/BUILD.bazel b/pw_toolchain/arm_gcc/BUILD.bazel index 930b48eb59..789fdf0551 100644 --- a/pw_toolchain/arm_gcc/BUILD.bazel +++ b/pw_toolchain/arm_gcc/BUILD.bazel @@ -253,15 +253,15 @@ cc_toolchain( "//pw_toolchain/cc/args:common_warnings", "//pw_toolchain/cc/args:color_diagnostics", ] + select({ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0": [":cortex-m0"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus": [":cortex-m0plus"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m3": [":cortex-m3"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33": [":cortex-m33"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33+nofp": [":cortex-m33+nofp"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m4": [":cortex-m4"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m4+nofp": [":cortex-m4+nofp"], - "@pw_toolchain//constraints/arm_mcpu:cortex-m7": [":cortex-m7"], - "@pw_toolchain//constraints/arm_mcpu:none": [], + "//pw_build/constraints/arm:cortex-m0": [":cortex-m0"], + "//pw_build/constraints/arm:cortex-m0plus": [":cortex-m0plus"], + "//pw_build/constraints/arm:cortex-m3": [":cortex-m3"], + "//pw_build/constraints/arm:cortex-m33": [":cortex-m33"], + "//pw_build/constraints/arm:cortex-m33+nofp": [":cortex-m33+nofp"], + "//pw_build/constraints/arm:cortex-m4": [":cortex-m4"], + "//pw_build/constraints/arm:cortex-m4+nofp": [":cortex-m4+nofp"], + "//pw_build/constraints/arm:cortex-m7": [":cortex-m7"], + "//pw_build/constraints/arm:none": [], }) + [ ":thumb_abi", # TODO(b/353576440): Enable unified assembly syntax. @@ -290,15 +290,15 @@ cc_toolchain( "//pw_toolchain/cc/capability:linker_is_gcc", ], target_compatible_with = select({ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m3": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m33+nofp": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m4": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m4+nofp": [], - "@pw_toolchain//constraints/arm_mcpu:cortex-m7": [], - "@pw_toolchain//constraints/arm_mcpu:none": ["@platforms//:incompatible"], + "//pw_build/constraints/arm:cortex-m0": [], + "//pw_build/constraints/arm:cortex-m0plus": [], + "//pw_build/constraints/arm:cortex-m3": [], + "//pw_build/constraints/arm:cortex-m33": [], + "//pw_build/constraints/arm:cortex-m33+nofp": [], + "//pw_build/constraints/arm:cortex-m4": [], + "//pw_build/constraints/arm:cortex-m4+nofp": [], + "//pw_build/constraints/arm:cortex-m7": [], + "//pw_build/constraints/arm:none": ["@platforms//:incompatible"], }), tool_map = "@gcc_arm_none_eabi_toolchain//:all_tools", visibility = ["//pw_toolchain:__pkg__"], @@ -307,7 +307,7 @@ cc_toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m0", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0", + "//pw_build/constraints/arm:cortex-m0", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -316,7 +316,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m0plus", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus", + "//pw_build/constraints/arm:cortex-m0plus", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -325,7 +325,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m3", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m3", + "//pw_build/constraints/arm:cortex-m3", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -334,7 +334,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m4", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m4", + "//pw_build/constraints/arm:cortex-m4", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -343,7 +343,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m4+nofp", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m4+nofp", + "//pw_build/constraints/arm:cortex-m4+nofp", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -352,7 +352,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m7", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m7", + "//pw_build/constraints/arm:cortex-m7", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -361,7 +361,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m33", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m33", + "//pw_build/constraints/arm:cortex-m33", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", @@ -370,7 +370,7 @@ toolchain( toolchain( name = "arm_gcc_cc_toolchain_cortex-m33+nofp", target_compatible_with = [ - "@pw_toolchain//constraints/arm_mcpu:cortex-m33+nofp", + "//pw_build/constraints/arm:cortex-m33+nofp", ], toolchain = ":arm_gcc_toolchain_cortex-m", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", diff --git a/pw_toolchain/build_external/llvm_clang.BUILD b/pw_toolchain/build_external/llvm_clang.BUILD index e372bef4af..c1749e56a9 100644 --- a/pw_toolchain/build_external/llvm_clang.BUILD +++ b/pw_toolchain/build_external/llvm_clang.BUILD @@ -19,7 +19,7 @@ load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool") load("@rules_cc//cc/toolchains:tool_map.bzl", "cc_tool_map") load("@bazel_skylib//rules/directory:directory.bzl", "directory") load("@bazel_skylib//rules/directory:subdirectory.bzl", "subdirectory") -load("@pigweed//pw_build/constraints/cortex_m:lists.bzl", "ALL_CORTEX_M_CPUS") +load("@pigweed//pw_build/constraints/arm:lists.bzl", "ALL_CORTEX_M_CPUS") load("@pigweed//pw_build:glob_dirs.bzl", "match_dir") load("@bazel_skylib//lib:selects.bzl", "selects") diff --git a/pw_toolchain_bazel/MODULE.bazel b/pw_toolchain_bazel/MODULE.bazel index b13a17692f..68970ee074 100644 --- a/pw_toolchain_bazel/MODULE.bazel +++ b/pw_toolchain_bazel/MODULE.bazel @@ -22,3 +22,8 @@ module( # rules_cc. For that reason, this primarily acts as a FYI. You'll still need # to explicitly list this dependency in your own project's MODULE.bazel file. bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "pigweed") +local_path_override( + module_name = "pigweed", + path = "../", +) diff --git a/pw_toolchain_bazel/constraints/arm_mcpu/BUILD.bazel b/pw_toolchain_bazel/constraints/arm_mcpu/BUILD.bazel index 5e7370bbd0..562445c693 100644 --- a/pw_toolchain_bazel/constraints/arm_mcpu/BUILD.bazel +++ b/pw_toolchain_bazel/constraints/arm_mcpu/BUILD.bazel @@ -16,75 +16,63 @@ package(default_visibility = ["//visibility:public"]) licenses(["notice"]) -# The target Arm processor. -# -# The values of this constraint_setting correspond to valid values of the -mcpu -# flag for Arm gcc. See -# https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-mcpu-2. These -# values are intended to be used in `target_compatible_with` attributes of -# toolchains which specify the corresponding value of -mcpu. -# -# The constraint_values are not currently exhaustively enumerated (only a few -# of the legal -mcpu values have corresponding constraint_values). The intent -# is for additional values to be added when needed. -# -# The intent is to support only (processor type + optional architectural -# extensions) forms of -mcpu (e.g., cortex-m4 or cortex-m4+nofp), not march -# values (e.g., armv7e-m). This is because it is recommended to use (processor -# type + optional architectural extensions) when configuring Arm GCC (see -# https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu). -# In addition, the march values can already be captured using @platforms//cpu. -constraint_setting( - name = "mcpu", - default_constraint_value = "none", -) +# These are deprecated! See @pigweed//pw_build/constraints/arm. -constraint_value( +alias( name = "none", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:none", ) -constraint_value( +alias( name = "cortex-a32", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-a32", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m0", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m0", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m0plus", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m0plus", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m3", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m3", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m4", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m4", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m4+nofp", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m4+nofp", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m7", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m7", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m33", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m33", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) -constraint_value( +alias( name = "cortex-m33+nofp", - constraint_setting = ":mcpu", + actual = "@pigweed//pw_build/constraints/arm:cortex-m33+nofp", + deprecation = "Reference constraints through @pigweed//pw_build/constraints/arm:BUILD", ) diff --git a/targets/rp2040/BUILD.bazel b/targets/rp2040/BUILD.bazel index ed6614c185..0680b81d4e 100644 --- a/targets/rp2040/BUILD.bazel +++ b/targets/rp2040/BUILD.bazel @@ -60,7 +60,7 @@ platform( "@pico-sdk//bazel/constraint:rp2040", # For toolchain selection. "@platforms//cpu:armv6-m", - "@pw_toolchain//constraints/arm_mcpu:cortex-m0plus", + "//pw_build/constraints/arm:cortex-m0plus", ], flags = flags_from_dict({ "@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT": ":rp2040_linker_script", @@ -75,7 +75,7 @@ platform( "@pico-sdk//bazel/constraint:rp2350", # For toolchain selection. "@platforms//cpu:armv8-m", - "@pw_toolchain//constraints/arm_mcpu:cortex-m33", + "//pw_build/constraints/arm:cortex-m33", ], flags = flags_from_dict({ "@pico-sdk//bazel/config:PICO_DEFAULT_LINKER_SCRIPT": ":rp2350_linker_script", diff --git a/targets/stm32f429i_disc1/BUILD.bazel b/targets/stm32f429i_disc1/BUILD.bazel index 22a78a341c..8052e4105e 100644 --- a/targets/stm32f429i_disc1/BUILD.bazel +++ b/targets/stm32f429i_disc1/BUILD.bazel @@ -29,7 +29,7 @@ platform( "//pw_sys_io_baremetal_stm32f429:compatible", "@platforms//cpu:armv7e-m", "@platforms//os:none", - "@pw_toolchain//constraints/arm_mcpu:cortex-m4", + "//pw_build/constraints/arm:cortex-m4", "@rust_crates//:no_std", ], flags = flags_from_dict({ diff --git a/targets/stm32f429i_disc1_stm32cube/BUILD.bazel b/targets/stm32f429i_disc1_stm32cube/BUILD.bazel index e4da6bcd63..02d55a741c 100644 --- a/targets/stm32f429i_disc1_stm32cube/BUILD.bazel +++ b/targets/stm32f429i_disc1_stm32cube/BUILD.bazel @@ -55,7 +55,7 @@ platform( "@freertos//:disable_task_statics", "@platforms//cpu:armv7e-m", "@platforms//os:none", - "@pw_toolchain//constraints/arm_mcpu:cortex-m4", + "//pw_build/constraints/arm:cortex-m4", "@rust_crates//:no_std", ], flags = flags_from_dict(FREERTOS_FLAGS | {