Skip to content

Commit

Permalink
Emit correct darwin_x86_64 CPU value if not using Xcode
Browse files Browse the repository at this point in the history
Previously, if not using the Xcode toolchain, for example because the
locator failed, the standard Unix C++ toolchain was created with a CPU
value of either `darwin_arm64` or `darwin`, depending on the host
architecture. The latter, when appended to
`@local_config_cc//:cc-compiler-` in the toolchain BUILD template,
results in a reference to a non-existent toolchain.
  • Loading branch information
fmeum committed Feb 11, 2022
1 parent 8431ef3 commit de84788
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cpp/lib_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def get_cpu_value(repository_ctx):
arch = repository_ctx.os.arch
if os_name.startswith("mac os"):
# Check if we are on x86_64 or arm64 and return the corresponding cpu value.
return "darwin" + ("_arm64" if arch == "aarch64" else "")
return "darwin" + ("_arm64" if arch == "aarch64" else "_x86_64")
if os_name.find("freebsd") != -1:
return "freebsd"
if os_name.find("openbsd") != -1:
Expand Down

0 comments on commit de84788

Please sign in to comment.