-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLVM] Restore LLVM toolchains patch removed by #2013
This patch turns out to be essential for Mac x86->Mac ARM cross compilation to work (jax-ml/jax#15951). Unfortunately there's no way to test this except manually, because we have no Mac ARM machines in CI at the moment. PiperOrigin-RevId: 531065713
- Loading branch information
1 parent
b637e62
commit 1d4e70b
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
index d53167dc618d..de20ef527d05 100644 | ||
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
@@ -19,6 +19,14 @@ licenses(["notice"]) | ||
|
||
exports_files(["LICENSE.TXT"]) | ||
|
||
+config_setting( | ||
+ name = "macos_arm64", | ||
+ values = { | ||
+ "apple_platform_type": "macos", | ||
+ "cpu": "darwin_arm64", | ||
+ }, | ||
+) | ||
+ | ||
# It may be tempting to add compiler flags here, but that should be avoided. | ||
# The necessary warnings and other compile flags should be provided by the | ||
# toolchain or the `.bazelrc` file. This is just a workaround until we have a | ||
diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
index b15ec9e1bb39..0d95a1e4d5c1 100644 | ||
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
@@ -89,7 +89,7 @@ os_defines = select({ | ||
# TODO: We should split out host vs. target here. | ||
llvm_config_defines = os_defines + select({ | ||
"@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"), | ||
- "@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), | ||
+ "//llvm:macos_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), | ||
"@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"), | ||
"@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), | ||
"@bazel_tools//src/conditions:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
index d53167dc618d..de20ef527d05 100644 | ||
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | ||
@@ -19,6 +19,14 @@ licenses(["notice"]) | ||
|
||
exports_files(["LICENSE.TXT"]) | ||
|
||
+config_setting( | ||
+ name = "macos_arm64", | ||
+ values = { | ||
+ "apple_platform_type": "macos", | ||
+ "cpu": "darwin_arm64", | ||
+ }, | ||
+) | ||
+ | ||
# It may be tempting to add compiler flags here, but that should be avoided. | ||
# The necessary warnings and other compile flags should be provided by the | ||
# toolchain or the `.bazelrc` file. This is just a workaround until we have a | ||
diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
index b15ec9e1bb39..0d95a1e4d5c1 100644 | ||
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
@@ -89,7 +89,7 @@ os_defines = select({ | ||
# TODO: We should split out host vs. target here. | ||
llvm_config_defines = os_defines + select({ | ||
"@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"), | ||
- "@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), | ||
+ "//llvm:macos_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), | ||
"@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"), | ||
"@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), | ||
"@bazel_tools//src/conditions:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters