Permalink
Browse files

Bug 638149 - Need a way to disable -dead_strip on OS X. r=ted

  • Loading branch information...
Rafael Ávila de Espíndola
Rafael Ávila de Espíndola committed Apr 8, 2011
1 parent 9c8020f commit 1dc7419b16130d638f438b499a006513b0e95175
Showing with 42 additions and 2 deletions.
  1. +1 −0 aclocal.m4
  2. +15 −0 build/autoconf/lto.m4
  3. +5 −1 configure.in
  4. +1 −0 js/src/aclocal.m4
  5. +15 −0 js/src/build/autoconf/lto.m4
  6. +5 −1 js/src/configure.in
View
@@ -14,6 +14,7 @@ builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/mozprog.m4)dnl
builtin(include, build/autoconf/mozheader.m4)dnl
builtin(include, build/autoconf/acwinpaths.m4)dnl
+builtin(include, build/autoconf/lto.m4)dnl
MOZ_PROG_CHECKMSYS()
View
@@ -0,0 +1,15 @@
+dnl check if the build is using lto. This is really primitive and only detects llvm based
+dnl compilers right now.
+AC_DEFUN(MOZ_DOING_LTO,
+[
+ cat > conftest.c <<EOF
+ int foo = 1;
+EOF
+ $1=no
+ if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '^target triple =' conftest.s; then
+ $1=yes
+ fi
+ fi
+ rm -f conftest.[cs]
+])
View
@@ -2007,6 +2007,8 @@ fi
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 ========================================================
@@ -2108,9 +2110,11 @@ case "$target" in
# 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
View
@@ -9,5 +9,6 @@ builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/moznbytetype.m4)dnl
builtin(include, build/autoconf/mozprog.m4)dnl
builtin(include, build/autoconf/acwinpaths.m4)dnl
+builtin(include, build/autoconf/lto.m4)dnl
MOZ_PROG_CHECKMSYS()
@@ -0,0 +1,15 @@
+dnl check if the build is using lto. This is really primitive and only detects llvm based
+dnl compilers right now.
+AC_DEFUN(MOZ_DOING_LTO,
+[
+ cat > conftest.c <<EOF
+ int foo = 1;
+EOF
+ $1=no
+ if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '^target triple =' conftest.s; then
+ $1=yes
+ fi
+ fi
+ rm -f conftest.[cs]
+])
View
@@ -1886,6 +1886,8 @@ if test "$_python_res" != 0; then
fi
AC_MSG_RESULT([yes])
+MOZ_DOING_LTO(lto_is_enabled)
+
dnl ========================================================
dnl System overrides of the defaults for target
dnl ========================================================
@@ -1990,9 +1992,11 @@ case "$target" in
# 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

0 comments on commit 1dc7419

Please sign in to comment.