Bug 904979 - Disable ICF and dead code removal on local builds. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 15 Aug 2013 23:45:10 +0900
changeset 142781 a5150f990fadcfe5997b15a3d9c53e7293a3db54
parent 142780 6f24ebad0ad8287dc80fe805a91f03932d0ce8f2
child 142782 94088b6bf1619e7f452f86506bc92f5d3c6b3f63
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersted
bugs904979
milestone26.0a1
Bug 904979 - Disable ICF and dead code removal on local builds. r=ted
build/autoconf/compiler-opts.m4
js/src/build/autoconf/compiler-opts.m4
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -135,30 +135,33 @@ if test "$GNU_CC" -a -n "$DEVELOPER_OPTI
             else
                 rm -rf $_objdir/build/unix/gold
             fi
         fi
     fi
 fi
 
 if test "$GNU_CC"; then
-    CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
-    CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fno-exceptions"
+    if test -z "$DEVELOPER_OPTIONS"; then
+        CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
+        CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
+    fi
+    CXXFLAGS="$CXXFLAGS -fno-exceptions"
 fi
 
 dnl ========================================================
 dnl = Identical Code Folding
 dnl ========================================================
 
 MOZ_ARG_DISABLE_BOOL(icf,
 [  --disable-icf          Disable Identical Code Folding],
     MOZ_DISABLE_ICF=1,
     MOZ_DISABLE_ICF= )
 
-if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF"; then
+if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
     AC_CACHE_CHECK([whether the linker supports Identical Code Folding],
         LD_SUPPORTS_ICF,
         [echo 'int foo() {return 42;}' \
               'int bar() {return 42;}' \
               'int main() {return foo() - bar();}' > conftest.${ac_ext}
         # If the linker supports ICF, foo and bar symbols will have
         # the same address
         if AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2]) &&
@@ -179,17 +182,17 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -
         LDFLAGS="$_SAVE_LDFLAGS"
     fi
 fi
 
 dnl ========================================================
 dnl = Automatically remove dead symbols
 dnl ========================================================
 
-if test "$GNU_CC" -a "$GCC_USE_GNU_LD"; then
+if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
     if test -n "$MOZ_DEBUG_FLAGS"; then
         dnl See bug 670659
         AC_CACHE_CHECK([whether removing dead symbols breaks debugging],
             GC_SECTIONS_BREAKS_DEBUG_RANGES,
             [echo 'int foo() {return 42;}' \
                   'int bar() {return 1;}' \
                   'int main() {return foo();}' > conftest.${ac_ext}
             if AC_TRY_COMMAND([${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2]) &&
--- a/js/src/build/autoconf/compiler-opts.m4
+++ b/js/src/build/autoconf/compiler-opts.m4
@@ -135,30 +135,33 @@ if test "$GNU_CC" -a -n "$DEVELOPER_OPTI
             else
                 rm -rf $_objdir/build/unix/gold
             fi
         fi
     fi
 fi
 
 if test "$GNU_CC"; then
-    CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
-    CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fno-exceptions"
+    if test -z "$DEVELOPER_OPTIONS"; then
+        CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
+        CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
+    fi
+    CXXFLAGS="$CXXFLAGS -fno-exceptions"
 fi
 
 dnl ========================================================
 dnl = Identical Code Folding
 dnl ========================================================
 
 MOZ_ARG_DISABLE_BOOL(icf,
 [  --disable-icf          Disable Identical Code Folding],
     MOZ_DISABLE_ICF=1,
     MOZ_DISABLE_ICF= )
 
-if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF"; then
+if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
     AC_CACHE_CHECK([whether the linker supports Identical Code Folding],
         LD_SUPPORTS_ICF,
         [echo 'int foo() {return 42;}' \
               'int bar() {return 42;}' \
               'int main() {return foo() - bar();}' > conftest.${ac_ext}
         # If the linker supports ICF, foo and bar symbols will have
         # the same address
         if AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2]) &&
@@ -179,17 +182,17 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -
         LDFLAGS="$_SAVE_LDFLAGS"
     fi
 fi
 
 dnl ========================================================
 dnl = Automatically remove dead symbols
 dnl ========================================================
 
-if test "$GNU_CC" -a "$GCC_USE_GNU_LD"; then
+if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
     if test -n "$MOZ_DEBUG_FLAGS"; then
         dnl See bug 670659
         AC_CACHE_CHECK([whether removing dead symbols breaks debugging],
             GC_SECTIONS_BREAKS_DEBUG_RANGES,
             [echo 'int foo() {return 42;}' \
                   'int bar() {return 1;}' \
                   'int main() {return foo();}' > conftest.${ac_ext}
             if AC_TRY_COMMAND([${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2]) &&