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
MOZ_PROG_CHECKMSYS()
# 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.
MOZ_READ_MOZCONFIG(mozilla)
--- 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`
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
+MOZ_DOING_LTO(lto_is_enabled)
+
dnl ========================================================
dnl System overrides of the defaults for target
dnl ========================================================
case "$target" in
*-aix*)
AC_DEFINE(AIX)
if test ! "$GNU_CC"; then
@@ -1947,19 +1949,21 @@ ld.])
STRIP="$STRIP -x -S"
_PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
# 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."
else
dnl check for the presence of the -dead_strip linker flag
AC_MSG_CHECKING([for -dead_strip option to ld])
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-dead_strip"
AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
if test -n "$_HAVE_DEAD_STRIP" ; then