Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 1dc7419b16130d638f438b499a006513b0e95175 1 parent 9c8020f
authored April 09, 2011
1  aclocal.m4
@@ -14,6 +14,7 @@ builtin(include, build/autoconf/altoptions.m4)dnl
14 14
 builtin(include, build/autoconf/mozprog.m4)dnl
15 15
 builtin(include, build/autoconf/mozheader.m4)dnl
16 16
 builtin(include, build/autoconf/acwinpaths.m4)dnl
  17
+builtin(include, build/autoconf/lto.m4)dnl
17 18
 
18 19
 MOZ_PROG_CHECKMSYS()
19 20
 
15  build/autoconf/lto.m4
... ...
@@ -0,0 +1,15 @@
  1
+dnl check if the build is using lto. This is really primitive and only detects llvm based
  2
+dnl compilers right now.
  3
+AC_DEFUN(MOZ_DOING_LTO,
  4
+[
  5
+  cat > conftest.c <<EOF
  6
+                  int foo = 1;
  7
+EOF
  8
+  $1=no
  9
+  if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
  10
+    if grep '^target triple =' conftest.s; then
  11
+      $1=yes
  12
+    fi
  13
+  fi
  14
+  rm -f conftest.[cs]
  15
+])
6  configure.in
@@ -2007,6 +2007,8 @@ fi
2007 2007
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
2008 2008
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
2009 2009
 
  2010
+MOZ_DOING_LTO(lto_is_enabled)
  2011
+
2010 2012
 dnl ========================================================
2011 2013
 dnl System overrides of the defaults for target
2012 2014
 dnl ========================================================
@@ -2108,9 +2110,11 @@ case "$target" in
2108 2110
     # builds.
2109 2111
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
2110 2112
 
  2113
+    if test "x$lto_is_enabled" = "xyes"; then
  2114
+        echo "Skipping -dead_strip because lto is enabled."
2111 2115
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
2112 2116
     dnl ===================================================================
2113  
-    if test "x$enable_dtrace" = "xyes"; then
  2117
+    elif test "x$enable_dtrace" = "xyes"; then
2114 2118
         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
2115 2119
     else
2116 2120
         dnl check for the presence of the -dead_strip linker flag
1  js/src/aclocal.m4
@@ -9,5 +9,6 @@ builtin(include, build/autoconf/altoptions.m4)dnl
9 9
 builtin(include, build/autoconf/moznbytetype.m4)dnl
10 10
 builtin(include, build/autoconf/mozprog.m4)dnl
11 11
 builtin(include, build/autoconf/acwinpaths.m4)dnl
  12
+builtin(include, build/autoconf/lto.m4)dnl
12 13
 
13 14
 MOZ_PROG_CHECKMSYS()
15  js/src/build/autoconf/lto.m4
... ...
@@ -0,0 +1,15 @@
  1
+dnl check if the build is using lto. This is really primitive and only detects llvm based
  2
+dnl compilers right now.
  3
+AC_DEFUN(MOZ_DOING_LTO,
  4
+[
  5
+  cat > conftest.c <<EOF
  6
+                  int foo = 1;
  7
+EOF
  8
+  $1=no
  9
+  if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
  10
+    if grep '^target triple =' conftest.s; then
  11
+      $1=yes
  12
+    fi
  13
+  fi
  14
+  rm -f conftest.[cs]
  15
+])
6  js/src/configure.in
@@ -1886,6 +1886,8 @@ if test "$_python_res" != 0; then
1886 1886
 fi
1887 1887
 AC_MSG_RESULT([yes])
1888 1888
 
  1889
+MOZ_DOING_LTO(lto_is_enabled)
  1890
+
1889 1891
 dnl ========================================================
1890 1892
 dnl System overrides of the defaults for target
1891 1893
 dnl ========================================================
@@ -1990,9 +1992,11 @@ case "$target" in
1990 1992
     # builds.
1991 1993
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1992 1994
 
  1995
+    if test "x$lto_is_enabled" = "xyes"; then
  1996
+        echo "Skipping -dead_strip because lto is enabled."
1993 1997
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
1994 1998
     dnl ===================================================================
1995  
-    if test "x$enable_dtrace" = "xyes"; then
  1999
+    elif test "x$enable_dtrace" = "xyes"; then
1996 2000
         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1997 2001
     else
1998 2002
         dnl check for the presence of the -dead_strip linker flag

0 notes on commit 1dc7419

Please sign in to comment.
Something went wrong with that request. Please try again.