From e74015df8fef0c81754aa8cd65a3ac4398ea1e46 Mon Sep 17 00:00:00 2001 From: Noah Graf Date: Tue, 28 Oct 2025 11:39:32 -0500 Subject: [PATCH 1/2] Made changes to support floating point embedded units --- rust/platform/triple_mappings.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/platform/triple_mappings.bzl b/rust/platform/triple_mappings.bzl index 6070591e6b..b51e401b17 100644 --- a/rust/platform/triple_mappings.bzl +++ b/rust/platform/triple_mappings.bzl @@ -58,7 +58,9 @@ SUPPORTED_T2_PLATFORM_TRIPLES = { "riscv64gc-unknown-linux-gnu": _support(std = True, host_tools = False), "riscv64gc-unknown-none-elf": _support(std = True, host_tools = False), "s390x-unknown-linux-gnu": _support(std = True, host_tools = True), + "thumbv6m-none-eabi": _support(std = True, host_tools = False), "thumbv7em-none-eabi": _support(std = True, host_tools = False), + "thumbv7em-none-eabihf": _support(std = True, host_tools = False), "thumbv8m.main-none-eabi": _support(std = True, host_tools = False), "wasm32-unknown-emscripten": _support(std = True, host_tools = False), "wasm32-unknown-unknown": _support(std = True, host_tools = False), @@ -282,12 +284,13 @@ _SYSTEM_TO_STDLIB_LINKFLAGS = { "windows": ["advapi32.lib", "ws2_32.lib", "userenv.lib", "Bcrypt.lib"], } -def cpu_arch_to_constraints(cpu_arch, *, system = None): +def cpu_arch_to_constraints(cpu_arch, *, system = None, abi = None): """Returns a list of constraint values which represents a triple's CPU. Args: cpu_arch (str): The architecture to match constraints for system (str, optional): The system for the associated ABI value. + abi (str): The application binary interface required for the target platform Returns: List: A list of labels to constraint values @@ -298,7 +301,7 @@ def cpu_arch_to_constraints(cpu_arch, *, system = None): plat_suffix = _CPU_ARCH_TO_BUILTIN_PLAT_SUFFIX[cpu_arch] # Patch armv7e-m to mf if hardfloat abi is selected - if plat_suffix == "armv7e-m" and system == "eabihf": + if plat_suffix == "armv7e-m" and (system == "eabihf" or abi == "eabihf"): plat_suffix = "armv7e-mf" return ["@platforms//cpu:{}".format(plat_suffix)] @@ -462,6 +465,7 @@ def triple_to_constraint_set(target_triple): constraint_set += cpu_arch_to_constraints( triple_struct.arch, system = triple_struct.system, + abi = triple_struct.abi, ) constraint_set += vendor_to_constraints(triple_struct.vendor) constraint_set += system_to_constraints(triple_struct.system) From 328e5b8a43155a6b1bc44c08db3214ce215c1d99 Mon Sep 17 00:00:00 2001 From: Noah Graf Date: Tue, 28 Oct 2025 11:47:48 -0500 Subject: [PATCH 2/2] Marked param as optional --- rust/platform/triple_mappings.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/platform/triple_mappings.bzl b/rust/platform/triple_mappings.bzl index b51e401b17..d579cf7d00 100644 --- a/rust/platform/triple_mappings.bzl +++ b/rust/platform/triple_mappings.bzl @@ -290,7 +290,7 @@ def cpu_arch_to_constraints(cpu_arch, *, system = None, abi = None): Args: cpu_arch (str): The architecture to match constraints for system (str, optional): The system for the associated ABI value. - abi (str): The application binary interface required for the target platform + abi (str, optional): The application binary interface required for the target platform Returns: List: A list of labels to constraint values