[llvm] r198087 - Strip dead code when linking by default with BFD ld (linux, ...) and ld64 (os x).

Doug Gilmore Doug.Gilmore at imgtec.com
Thu Jan 2 19:01:01 PST 2014


On 12/27/2013 02:39 PM, Nico Weber wrote:
> Author: nico
> Date: Fri Dec 27 16:38:59 2013
> New Revision: 198087
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=198087&view=rev
> Log:
> 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.
> ...
Unfortunately this is causing relocation problems:

http://llvm.org/bugs/show_bug.cgi?id=18360

Is it OK if we apply the following patch until we resolve the issue at hand?

Thanks,

Doug

diff --git a/Makefile.rules b/Makefile.rules
index 1eeadac..9a42f83 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -611,9 +611,12 @@ endif
 # By default, strip dead symbols at link time
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
 ifneq ($(HOST_OS),Darwin)
+# Disabled for Mips until bug 18360 is resolved.
+ifneq ($(HOST_ARCH),Mips)
   CXX.Flags += -ffunction-sections -fdata-sections
 endif
 endif
+endif
 ifndef NO_DEAD_STRIP
   ifeq ($(HOST_OS),Darwin)
     LD.Flags += -Wl,-dead_strip





More information about the llvm-commits mailing list