Skip to content

Commit

Permalink
Define cc-compiler-darwin in Xcode toolchain
Browse files Browse the repository at this point in the history
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.

Fixes bazelbuild#14459

Closes bazelbuild#14796.

PiperOrigin-RevId: 451860477
Change-Id: Iec115f600ebb7ac0786b2169276d25e3ff5d54bf
  • Loading branch information
fmeum authored and copybara-github committed May 30, 2022
1 parent 4c3219e commit 2d42925
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/osx/crosstool/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2d42925

Please sign in to comment.