From d7c3dfd8bea41e67a62d00ad211c043cb70f4258 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 11 Feb 2022 16:23:29 +0100 Subject: [PATCH] Define cc-compiler-darwin in Xcode toolchain Previously, if the xcode_locator failed and cc_autoconf_toolchain used the non-Xcode C++ toolchain as a fallback, its reference to @local_config_cc//:cc-compiler-darwin, where darwin is the legacy cpu value for x86_64 macOS, would be invalid. --- tools/osx/crosstool/BUILD.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/osx/crosstool/BUILD.tpl b/tools/osx/crosstool/BUILD.tpl index 216feb5ac3b52b..f58841824e6b4e 100644 --- a/tools/osx/crosstool/BUILD.tpl +++ b/tools/osx/crosstool/BUILD.tpl @@ -80,6 +80,14 @@ cc_toolchain_suite( for arch in OSX_TOOLS_ARCHS ] +# When xcode_locator fails and causes cc_autoconf_toolchains to fall back +# to the non-Xcode C++ toolchain, it uses the legacy cpu value to refer to +# the toolchain, which is "darwin" for x86_64 macOS. +alias( + name = "cc-compiler-darwin", + actual = ":cc-compiler-darwin-x86_64", +) + [ cc_toolchain_config( name = arch,