Bug 537857 part 1 - Remove dead symbols in linker. r=ted
☠☠ backed out by 69bdf578a5dd ☠ ☠
authorTaras Glek <tglek@mozilla.com>
Tue, 28 Jun 2011 08:25:48 +0200
changeset 71912 e986c0494f1a8797a39497023dd4351f844998e0
parent 71911 0c259dad48acb7a9e540652716795824553111ce
child 71913 ebb9315861a417e712838ead036867b48531595b
push id20627
push userjdrew@mozilla.com
push dateTue, 28 Jun 2011 16:13:51 +0000
treeherdermozilla-central@d173bf22c9bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs537857
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 537857 part 1 - Remove dead symbols in linker. r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -1541,16 +1541,19 @@ if test "$GNU_CC"; then
     # FIXME: Let us build with strict aliasing. bug 414641.
     CFLAGS="$CFLAGS -fno-strict-aliasing"
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     DSO_LDOPTS='-shared'
     if test "$GCC_USE_GNU_LD"; then
         # Don't allow undefined symbols in libraries
         DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
+        LDFLAGS="$LDFLAGS -Wl,--gc-sections"
+        CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
+        CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
     fi
     WARNINGS_AS_ERRORS='-Werror'
     DSO_CFLAGS=''
     DSO_PIC_CFLAGS='-fPIC'
     ASFLAGS="$ASFLAGS -fPIC"
     _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
     _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
     _MOZ_EXCEPTIONS_FLAGS_ON='-fexceptions'