Skip to content

Commit

Permalink
Fix MacOS TF build by reverting an LLVM commit locally.
Browse files Browse the repository at this point in the history
Revert llvm/llvm-project@33e1713 which seems to break macOS CPU TF build.

PiperOrigin-RevId: 399933600
Change-Id: I2b4b25ff6b558687e29778649b195594a34c0f0d
  • Loading branch information
jurahul authored and tensorflower-gardener committed Sep 30, 2021
1 parent a589972 commit 62093ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions third_party/llvm/macos_build_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 1ebfdd7ba05aa861df0397caf4c910c4d6a2690f Mon Sep 17 00:00:00 2001
From: Rahul Joshi <jurahul@google.com>
Date: Wed, 29 Sep 2021 11:13:44 -0700
Subject: [PATCH] Revert "[Bazel] Add support for targeting macOS arm64"

This reverts commit 33e1713a00a5291e5de658d0eb0aebdbf1d3aa03.
---
utils/bazel/llvm-project-overlay/llvm/config.bzl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
index ff64df694048..55f3077bff74 100644
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
@@ -76,8 +76,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"),
- "@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"),
+ "@bazel_tools//src/conditions:darwin": native_arch_defines("X86", "x86_64-unknown-darwin"),
"@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"),
"//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),
}) + [
--
2.33.0.685.g46640cef36-goog

1 change: 1 addition & 0 deletions third_party/llvm/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ def repo(name):
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
],
build_file = "//third_party/llvm:BUILD.bazel",
patch_file = "//third_party/llvm:macos_build_fix.patch",
link_files = {"//third_party/llvm:run_lit.sh": "mlir/run_lit.sh"},
)

0 comments on commit 62093ca

Please sign in to comment.