[PATCH] D56898: gn build: unbreak mac (and maybe win) after r351258, r351277

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 20:04:03 PST 2019


thakis created this revision.
thakis added a reviewer: pcc.
Herald added a subscriber: srhines.

The check-hwasan build files assert that current_os == "linux" || current_os == "android", so pull it in only there.

ar is unused on mac, so don't set it in the stage2 toolchain. (It'd be nicer to use llvm-libtool on mac instead of host libtool, but llvm-libtool doesn't seem to understand the `-no_warning_for_no_symbols` flag.)


https://reviews.llvm.org/D56898

Files:
  llvm/utils/gn/build/toolchain/BUILD.gn
  llvm/utils/gn/secondary/BUILD.gn


Index: llvm/utils/gn/secondary/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/BUILD.gn
+++ llvm/utils/gn/secondary/BUILD.gn
@@ -5,10 +5,12 @@
 group("default") {
   deps = [
     "//clang/test",
-    "//compiler-rt/test/hwasan",
     "//lld/test",
     "//llvm/test",
   ]
+  if (current_os == "linux" || current_os == "android") {
+    deps += [ "//compiler-rt/test/hwasan" ]
+  }
 
   testonly = true
 }
Index: llvm/utils/gn/build/toolchain/BUILD.gn
===================================================================
--- llvm/utils/gn/build/toolchain/BUILD.gn
+++ llvm/utils/gn/build/toolchain/BUILD.gn
@@ -157,13 +157,17 @@
     cc = "bin/clang"
     cxx = "bin/clang++"
     ld = cxx
-    ar = "bin/llvm-ar"
+    if (current_os != "mac") {
+      ar = "bin/llvm-ar"
+    }
 
     deps = [
       "//:clang($host_toolchain)",
       "//:lld($host_toolchain)",
-      "//:llvm-ar($host_toolchain)",
     ]
+    if (current_os != "mac") {
+      deps += [ "//:llvm-ar($host_toolchain)" ]
+    }
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56898.182448.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190118/d45e986b/attachment.bin>


More information about the llvm-commits mailing list