diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-12-27 22:38:59 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-12-27 22:38:59 +0000 |
commit | 5e7c782b29d4317db9098e7482046fbbc9933054 (patch) | |
tree | 19e5a016b1bacfb6df8b1717dfd667b7ad975af0 /tools | |
parent | b2f47c6a3455a9d265e21c8ab1ca81657ff577a0 (diff) | |
download | llvm-5e7c782b29d4317db9098e7482046fbbc9933054.tar.gz llvm-5e7c782b29d4317db9098e7482046fbbc9933054.tar.bz2 llvm-5e7c782b29d4317db9098e7482046fbbc9933054.tar.xz |
Strip dead code when linking by default with BFD ld (linux, ...) and ld64 (os x).
This reduces the size of clang-format from 22 MB to 1.8 MB, diagtool goes from
21 MB to 2.8 MB, libclang.so goes from 29 MB to 20 MB, etc. The size of the
bin/ folder shrinks from 270 MB to 200 MB.
Targets that support plugins and don't already use EXPORTED_SYMBOL_FILE
(which libclang and libLTO already do) can set NO_DEAD_STRIP to opt out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/Makefile | 3 | ||||
-rw-r--r-- | tools/llc/Makefile | 3 | ||||
-rw-r--r-- | tools/llvm-shlib/Makefile | 3 | ||||
-rw-r--r-- | tools/lto/Makefile | 3 | ||||
-rw-r--r-- | tools/opt/Makefile | 3 |
5 files changed, 9 insertions, 6 deletions
diff --git a/tools/bugpoint/Makefile b/tools/bugpoint/Makefile index 20493218b0..96c0fcf519 100644 --- a/tools/bugpoint/Makefile +++ b/tools/bugpoint/Makefile @@ -12,4 +12,7 @@ TOOLNAME := bugpoint LINK_COMPONENTS := asmparser instrumentation scalaropts ipo linker bitreader \ bitwriter irreader vectorize objcarcopts +# Support plugins. +NO_DEAD_STRIP := 1 + include $(LEVEL)/Makefile.common diff --git a/tools/llc/Makefile b/tools/llc/Makefile index c24f378bc5..71bce4dc1a 100644 --- a/tools/llc/Makefile +++ b/tools/llc/Makefile @@ -11,5 +11,8 @@ LEVEL := ../.. TOOLNAME := llc LINK_COMPONENTS := all-targets bitreader asmparser irreader +# Support plugins. +NO_DEAD_STRIP := 1 + include $(LEVEL)/Makefile.common diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile index 92f3132ff5..317da51720 100644 --- a/tools/llvm-shlib/Makefile +++ b/tools/llvm-shlib/Makefile @@ -49,9 +49,6 @@ ifeq ($(HOST_OS),Darwin) endif # Include everything from the .a's into the shared library. LLVMLibsOptions := $(LLVMLibsOptions) -all_load - # extra options to override libtool defaults - LLVMLibsOptions := $(LLVMLibsOptions) \ - -Wl,-dead_strip # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') diff --git a/tools/lto/Makefile b/tools/lto/Makefile index cedbee188c..e2b0ff80ef 100644 --- a/tools/lto/Makefile +++ b/tools/lto/Makefile @@ -37,9 +37,6 @@ ifeq ($(HOST_OS),Darwin) -Wl,$(LTO_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \ -Wl,-compatibility_version -Wl,1 endif - # extra options to override libtool defaults - LLVMLibsOptions := $(LLVMLibsOptions) \ - -Wl,-dead_strip # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') diff --git a/tools/opt/Makefile b/tools/opt/Makefile index a451005574..fa2d014553 100644 --- a/tools/opt/Makefile +++ b/tools/opt/Makefile @@ -11,4 +11,7 @@ LEVEL := ../.. TOOLNAME := opt LINK_COMPONENTS := bitreader bitwriter asmparser irreader instrumentation scalaropts objcarcopts ipo vectorize all-targets +# Support plugins. +NO_DEAD_STRIP := 1 + include $(LEVEL)/Makefile.common |