diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-02-01 20:34:43 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-02-01 20:34:43 +0000 |
commit | a18761ab9ef2ac81cb1597a387687faa1f254fa0 (patch) | |
tree | aef47837bcb0d2b48656532d32bfd30f8b4ed347 | |
parent | 251e1488e195a0ab618e503fe5b2bc8ff18d1724 (diff) | |
download | llvm-a18761ab9ef2ac81cb1597a387687faa1f254fa0.zip llvm-a18761ab9ef2ac81cb1597a387687faa1f254fa0.tar.gz llvm-a18761ab9ef2ac81cb1597a387687faa1f254fa0.tar.bz2 |
gn build: Create regular archives for the sanitizer runtimes.
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.
Differential Revision: https://reviews.llvm.org/D57607
llvm-svn: 352907
-rw-r--r-- | llvm/utils/gn/build/BUILD.gn | 8 | ||||
-rw-r--r-- | llvm/utils/gn/build/BUILDCONFIG.gn | 1 | ||||
-rw-r--r-- | llvm/utils/gn/build/toolchain/BUILD.gn | 2 | ||||
-rw-r--r-- | llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn | 10 |
4 files changed, 18 insertions, 3 deletions
diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn index 4c5c3bb..cd22d21 100644 --- a/llvm/utils/gn/build/BUILD.gn +++ b/llvm/utils/gn/build/BUILD.gn @@ -136,6 +136,14 @@ config("no_rtti") { } } +# To make an archive that can be distributed, you need to remove this config and +# set complete_static_lib. +config("thin_archive") { + if (current_os != "win" && current_os != "mac") { + arflags = [ "-T" ] + } +} + config("llvm_code") { include_dirs = [ "//llvm/include", diff --git a/llvm/utils/gn/build/BUILDCONFIG.gn b/llvm/utils/gn/build/BUILDCONFIG.gn index cec736f..7de638f 100644 --- a/llvm/utils/gn/build/BUILDCONFIG.gn +++ b/llvm/utils/gn/build/BUILDCONFIG.gn @@ -6,6 +6,7 @@ shared_binary_target_configs = [ "//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", ] diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn index 4be5e4b..5ba76d4 100644 --- a/llvm/utils/gn/build/toolchain/BUILD.gn +++ b/llvm/utils/gn/build/toolchain/BUILD.gn @@ -50,7 +50,7 @@ template("unix_toolchain") { # 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 = [ diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn index 5979a69..fe5870a 100644 --- a/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn +++ b/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn @@ -74,7 +74,10 @@ static_library("hwasan") { 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 @@ static_library("hwasan_cxx") { 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", |