Skip to content

Commit 33e1713

Browse files
dfmGMNGeoffrey
authored andcommitted
[Bazel] Add support for targeting macOS arm64
In attempting to build JAX on Apple Silicon, we discovered an issue with the bazel configuration in llvm-project-overlay. This patch fixes the logic, at least when building JAX. More context is included on the following GitHub issue: jax-ml/jax#5501 Differential Revision: https://reviews.llvm.org/D109839
1 parent f2fa6ad commit 33e1713

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/bazel/llvm-project-overlay/llvm/config.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ os_defines = select({
7676
# TODO: We should split out host vs. target here.
7777
llvm_config_defines = os_defines + select({
7878
"@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"),
79-
"@bazel_tools//src/conditions:darwin": native_arch_defines("X86", "x86_64-unknown-darwin"),
79+
"@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"),
80+
"@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"),
8081
"@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"),
8182
"//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),
8283
}) + [

0 commit comments

Comments
 (0)