]> granicus.if.org Git - llvm/commitdiff
gn build: unbreak mac (and maybe win) after r351258, r351277
authorNico Weber <nicolasweber@gmx.de>
Fri, 18 Jan 2019 04:09:30 +0000 (04:09 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 18 Jan 2019 04:09:30 +0000 (04:09 +0000)
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.)

Differential Revision: https://reviews.llvm.org/D56898

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351519 91177308-0d34-0410-b5e6-96231b3b80d8

utils/gn/build/toolchain/BUILD.gn
utils/gn/secondary/BUILD.gn

index 97c64ffdf2d05fa5ef9a0175e5c420e73ad20cc1..ea0c68359a12379f8046163a98a783e29a8c52fd 100644 (file)
@@ -157,13 +157,17 @@ template("stage2_unix_toolchain") {
     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)" ]
+    }
   }
 }
 
index b8b748b8a2a03434073851af66897a397446ac27..0c79cd05c80f5e9ea94600c45e900c389639b06c 100644 (file)
@@ -5,10 +5,12 @@ import("//llvm/utils/gn/build/toolchain/compiler.gni")
 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
 }