Bug 653246 - Disable -dead_strip on OS X if LTO is enabled also on comm-central (port Bug 638149); r=Callek
Fri, 03 Jun 2011 13:50:11 +0100
changeset 7868 bc7df0f8a3f148047136e347c881de0a6143fc0c
parent 7867 c2d23014f95cce9b54fa13eadf185f5ce4004d56
child 7869 57310aa503db34bed0f2ad26e5b7f0a2ff754d4c
push idunknown
push userunknown
push dateunknown
bugs653246, 638149
Bug 653246 - Disable -dead_strip on OS X if LTO is enabled also on comm-central (port Bug 638149); r=Callek
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -8,16 +8,17 @@ builtin(include, mozilla/build/autoconf/
 builtin(include, mozilla/build/autoconf/nspr.m4)dnl
 builtin(include, mozilla/build/autoconf/nss.m4)dnl
 builtin(include, mozilla/build/autoconf/pkg.m4)dnl
 builtin(include, mozilla/build/autoconf/freetype2.m4)dnl
 builtin(include, mozilla/build/autoconf/codeset.m4)dnl
 builtin(include, mozilla/build/autoconf/altoptions.m4)dnl
 builtin(include, mozilla/build/autoconf/mozprog.m4)dnl
 builtin(include, mozilla/build/autoconf/acwinpaths.m4)dnl
+builtin(include, mozilla/build/autoconf/lto.m4)dnl
 # Read the user's .mozconfig script.  We can't do this in
 # configure.in: autoconf puts the argument parsing code above anything
 # expanded from configure.in, and we need to get the configure options
 # from .mozconfig in place before that argument parsing code.
--- a/configure.in
+++ b/configure.in
@@ -1832,16 +1832,18 @@ AC_MSG_RESULT([yes])
 dnl Get version of various core apps from the version files.
 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 case "$target" in
     if test ! "$GNU_CC"; then
@@ -1947,19 +1949,21 @@ ld.])
     STRIP="$STRIP -x -S"
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
+    if test "x$lto_is_enabled" = "xyes"; then
+        echo "Skipping -dead_strip because lto is enabled."
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
     dnl ===================================================================
-    if test "x$enable_dtrace" = "xyes"; then
+    elif test "x$enable_dtrace" = "xyes"; then
         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
         dnl check for the presence of the -dead_strip linker flag
         AC_MSG_CHECKING([for -dead_strip option to ld])
         LDFLAGS="$LDFLAGS -Wl,-dead_strip"
         AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
         if test -n "$_HAVE_DEAD_STRIP" ; then