Bug 590179. Use -fomit-frame-pointer when building opt builds on mac. r=ted, a=beltzner
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 27 Aug 2010 14:19:45 -0700
changeset 51603 fa9a6337669bf1283eb99f1abec57292c57b12ed
parent 51602 256514ea6d14d04230b0a6d64cf5eb69356bd4c5
child 51604 f87dcd8ad8e8b766c589f5a4d3385ae4d3eec388
push id15368
push userjlebar@mozilla.com
push dateFri, 27 Aug 2010 21:20:33 +0000
treeherdermozilla-central@44e28539ef9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, beltzner
bugs590179
milestone2.0b5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 590179. Use -fomit-frame-pointer when building opt builds on mac. r=ted, a=beltzner
configure.in
js/src/configure.in
xpcom/reflect/xptcall/src/md/unix/Makefile.in
--- a/configure.in
+++ b/configure.in
@@ -2029,17 +2029,17 @@ case "$target" in
 	    MKSHLIB_UNFORCE_ALL=''
 	;;
     esac
     ;;
 
 *-darwin*) 
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
-    MOZ_OPTIMIZE_FLAGS="-O3"
+    MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
     _PEDANTIC=
     CFLAGS="$CFLAGS -fpascal-strings -fno-common"
     CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1722,17 +1722,17 @@ case "$target" in
 	    MKSHLIB_UNFORCE_ALL=''
 	;;
     esac
     ;;
 
 *-darwin*) 
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
-    MOZ_OPTIMIZE_FLAGS="-O3"
+    MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
     _PEDANTIC=
     CFLAGS="$CFLAGS -fpascal-strings -fno-common"
     CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
@@ -59,16 +59,28 @@ FORCE_USE_PIC	= 1
 ifeq ($(OS_ARCH),SunOS)
 ifneq (86,$(findstring 86,$(OS_TEST)))
 # disable PGO for this directory with Sun Studio on SPARC because
 # compiling with xprofile=collect will insert code into nsXPTCStubBase::Stub##n
 NO_PROFILE_GUIDED_OPTIMIZE = 1
 endif
 endif
 
+ifeq (Darwin,$(OS_ARCH))
+ifeq (86,$(findstring 86,$(OS_TEST)))
+ifneq (x86_64,$(OS_TEST))
+# If we compile xptcinvoke_unixish_x86.cpp with -fomit-frame-pointer
+# we end up crashing on startup, presumably because of the %esp munging we do
+# when KEEP_STACK_16_BYTE_ALIGNED.  So let's not use that flag here.
+# NOTE: MODULE_OPTIMIZE_FLAGS must be set before including config.mk
+MODULE_OPTIMIZE_FLAGS=-O3
+endif
+endif
+endif
+
 include $(topsrcdir)/config/config.mk
 
 ######################################################################
 # i386 and beyond
 ######################################################################
 #
 # Lots of Unixish x86 flavors
 #