diff --git a/cc/toolchains/impl/toolchain_config.bzl b/cc/toolchains/impl/toolchain_config.bzl index 1f6efefe5..863bb4a70 100644 --- a/cc/toolchains/impl/toolchain_config.bzl +++ b/cc/toolchains/impl/toolchain_config.bzl @@ -84,9 +84,9 @@ def _cc_toolchain_config_impl(ctx): # compiler compiler = ctx.attr.compiler, target_cpu = ctx.attr.cpu, + target_libc = ctx.attr.target_libc, # Used by legacy features to determine if we're building for Apple platfroms or not # These fields are only relevant for legacy toolchain resolution. target_system_name = "", - target_libc = "", abi_version = "", abi_libc_version = "", ), @@ -105,6 +105,7 @@ cc_toolchain_config = rule( # Attributes new to this rule. "compiler": attr.string(default = ""), "cpu": attr.string(default = ""), + "target_libc": attr.string(default = ""), "tool_map": attr.label(providers = [ToolConfigInfo], mandatory = True), "args": attr.label_list(providers = [ArgsListInfo]), "known_features": attr.label_list(providers = [FeatureSetInfo]), diff --git a/cc/toolchains/toolchain.bzl b/cc/toolchains/toolchain.bzl index fa41163ab..c0b712426 100644 --- a/cc/toolchains/toolchain.bzl +++ b/cc/toolchains/toolchain.bzl @@ -186,6 +186,10 @@ def cc_toolchain( Label("//cc/toolchains/impl:windows_x86_64"): "win64", "//conditions:default": "", }), + target_libc = select({ + Label("//cc/toolchains/platforms:apple"): "macosx", + "//conditions:default": "", + }), visibility = ["//visibility:private"], **kwargs )