diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 4bfcdb7007e5..e1bead8a1807 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -77,6 +77,36 @@ GRE_MODULE = 1 LIBS = $(NSPR_LIBS) +ifdef GNU_CXX +ifdef INTEL_CXX +# icc gets special optimize flags +ifdef MOZ_PROFILE_GENERATE +MODULE_OPTIMIZE_FLAGS = -O0 +else +MODULE_OPTIMIZE_FLAGS = -O2 -ip +endif +else # not INTEL_CXX + +MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing -fno-stack-protector + +# We normally want -fomit-frame-pointer, but we want an explicit +# -fno-omit-frame-pointer if we're using a sampling profiler. +ifndef MOZ_PROFILING +MODULE_OPTIMIZE_FLAGS += -fomit-frame-pointer +else +MODULE_OPTIMIZE_FLAGS += -fno-omit-frame-pointer +endif + +endif +else # not GNU_CXX +ifeq ($(OS_ARCH),SunOS) +MODULE_OPTIMIZE_FLAGS = -xO4 +endif +ifeq ($(OS_ARCH),WINNT) +MODULE_OPTIMIZE_FLAGS = -O2 +endif +endif + ifeq ($(OS_ARCH),WINNT) NO_PROFILE_GUIDED_OPTIMIZE = 1 endif diff --git a/js/src/configure.in b/js/src/configure.in index 3ef055fde5e8..dad130cfa413 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1992,14 +1992,11 @@ case "$target" in *-darwin*) MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' - - MOZ_OPTIMIZE_FLAGS="-O3 -fstrict-aliasing -fno-stack-protector" - # We normally want -fomit-frame-pointer, but we want an explicit - # -fno-omit-frame-pointer if we're using a sampling profiler. + # If we're building with --enable-profiling, we need a frame pointer. if test -z "$MOZ_PROFILING"; then - MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS -fomit-frame-pointer" + MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer" else - MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS -fno-omit-frame-pointer" + MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer" fi _PEDANTIC= CFLAGS="$CFLAGS -fpascal-strings -fno-common"