[PATCH] D57607: gn build: Create regular archives for the sanitizer runtimes.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 1 11:27:14 PST 2019


pcc created this revision.
pcc added reviewers: thakis, phosek.
Herald added a subscriber: kubamracek.
Herald added a project: LLVM.

We'll need to do this eventually if we create an installable package.
For now, this lets me use the archives to build Android, whose build
system wants to copy the archives to another location.


Repository:
  rL LLVM

https://reviews.llvm.org/D57607

Files:
  llvm/utils/gn/build/BUILD.gn
  llvm/utils/gn/build/BUILDCONFIG.gn
  llvm/utils/gn/build/toolchain/BUILD.gn
  llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn


Index: llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
+++ llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
@@ -74,7 +74,10 @@
   output_dir = crt_current_out_dir
   output_name = "clang_rt.hwasan-$crt_current_target"
   complete_static_lib = true
-  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
+  configs -= [
+    "//llvm/utils/gn/build:llvm_code",
+    "//llvm/utils/gn/build:thin_archive",
+  ]
   configs += [ "//llvm/utils/gn/build:crt_code" ]
   deps = [
     ":sources",
@@ -85,7 +88,10 @@
   output_dir = crt_current_out_dir
   output_name = "clang_rt.hwasan_cxx-$crt_current_target"
   complete_static_lib = true
-  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
+  configs -= [
+    "//llvm/utils/gn/build:llvm_code",
+    "//llvm/utils/gn/build:thin_archive",
+  ]
   configs += [ "//llvm/utils/gn/build:crt_code" ]
   deps = [
     ":cxx_sources",
Index: llvm/utils/gn/build/toolchain/BUILD.gn
===================================================================
--- llvm/utils/gn/build/toolchain/BUILD.gn
+++ llvm/utils/gn/build/toolchain/BUILD.gn
@@ -50,7 +50,7 @@
         # Remove the output file first so that ar doesn't try to modify the
         # existing file.
         command =
-            "rm -f {{output}} && $ar rcsDT {{arflags}} {{output}} {{inputs}}"
+            "rm -f {{output}} && $ar rcsD {{arflags}} {{output}} {{inputs}}"
       }
       description = "AR {{output}}"
       outputs = [
Index: llvm/utils/gn/build/BUILDCONFIG.gn
===================================================================
--- llvm/utils/gn/build/BUILDCONFIG.gn
+++ llvm/utils/gn/build/BUILDCONFIG.gn
@@ -6,6 +6,7 @@
   "//llvm/utils/gn/build:compiler_defaults",
   "//llvm/utils/gn/build:llvm_code",
   "//llvm/utils/gn/build:no_rtti",
+  "//llvm/utils/gn/build:thin_archive",
   "//llvm/utils/gn/build:warn_covered_switch_default",
 ]
 
Index: llvm/utils/gn/build/BUILD.gn
===================================================================
--- llvm/utils/gn/build/BUILD.gn
+++ llvm/utils/gn/build/BUILD.gn
@@ -136,6 +136,12 @@
   }
 }
 
+config("thin_archive") {
+  if (current_os != "win" && current_os != "mac") {
+    arflags = [ "-T" ]
+  }
+}
+
 config("llvm_code") {
   include_dirs = [
     "//llvm/include",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57607.184803.patch
Type: text/x-patch
Size: 2379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190201/367187b1/attachment.bin>


More information about the llvm-commits mailing list