diff -uNr rust/platform/triple_mappings.bzl rust/platform/triple_mappings.bzl --- a/rust/platform/triple_mappings.bzl +++ b/rust/platform/triple_mappings.bzl @@ -1,6 +1,7 @@ """Helpers for constructing supported Rust platform triples""" load("//rust/platform:triple.bzl", "triple") +load("@@toolchains_llvm_bootstrapped+//constraints/libc:libc_versions.bzl", "DEFAULT_LIBC") def _support(*, std = False, host_tools = False): """Identify the type of support an associated platform triple has. @@ -334,10 +335,11 @@ all_abi_constraints = [] - # add constraints for MUSL static compilation and linking - # to separate the MUSL from the non-MUSL toolchain on x86_64 - # if abi == "musl" and system == "linux" and arch == "x86_64": - # all_abi_constraints.append("//rust/platform/constraints:musl_on") + if system == "linux": + if abi == "musl": + all_abi_constraints.append("@@toolchains_llvm_bootstrapped+//constraints/libc:musl") + elif abi.startswith("gnu"): + all_abi_constraints.append("@@toolchains_llvm_bootstrapped+//constraints/libc:{}".format(DEFAULT_LIBC)) # add constraints for iOS + watchOS simulator and device triples if system in ["ios", "watchos"]: