Bug 655003 - On Linux, use -Os on normal builds and -O3 when PGO is enabled. r=ted,a=sheriff

This commit is contained in:
Mike Hommey 2011-05-24 12:56:04 +02:00
parent a094756416
commit aaef70fff0
7 changed files with 23 additions and 5 deletions

View File

@ -315,6 +315,7 @@ WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@
MOZ_OPTIMIZE = @MOZ_OPTIMIZE@
MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
MOZ_PGO_OPTIMIZE_FLAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@

View File

@ -422,8 +422,13 @@ ifdef MODULE_OPTIMIZE_FLAGS
CFLAGS += $(MODULE_OPTIMIZE_FLAGS)
CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS)
else
ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
CFLAGS += $(MOZ_PGO_OPTIMIZE_FLAGS)
CXXFLAGS += $(MOZ_PGO_OPTIMIZE_FLAGS)
else
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
endif # neq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
endif # MODULE_OPTIMIZE_FLAGS
else
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)

View File

@ -2188,10 +2188,12 @@ ia64*-hpux*)
esac
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
MOZ_FRAMEPTR_FLAGS="-fomit-frame-pointer"
else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
MOZ_FRAMEPTR_FLAGS="-fno-omit-frame-pointer"
fi
MOZ_PGO_OPTIMIZE_FLAGS="-O3 $MOZ_FRAMEPTR_FLAGS"
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK $MOZ_FRAMEPTR_FLAGS"
MOZ_DEBUG_FLAGS="-g"
fi
@ -7183,6 +7185,7 @@ AC_SUBST(MOZ_OPTIMIZE)
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable generation of debug symbols

View File

@ -145,6 +145,7 @@ FAIL_ON_WARNINGS = @FAIL_ON_WARNINGS@
MOZ_OPTIMIZE = @MOZ_OPTIMIZE@
MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
MOZ_PGO_OPTIMIZE_FLAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@

View File

@ -422,8 +422,13 @@ ifdef MODULE_OPTIMIZE_FLAGS
CFLAGS += $(MODULE_OPTIMIZE_FLAGS)
CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS)
else
ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
CFLAGS += $(MOZ_PGO_OPTIMIZE_FLAGS)
CXXFLAGS += $(MOZ_PGO_OPTIMIZE_FLAGS)
else
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
endif # neq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
endif # MODULE_OPTIMIZE_FLAGS
else
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)

View File

@ -2102,10 +2102,12 @@ ia64*-hpux*)
esac
# If we're building with --enable-profiling, we need a frame pointer.
if test -z "$MOZ_PROFILING"; then
MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
MOZ_FRAMEPTR_FLAGS="-fomit-frame-pointer"
else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
MOZ_FRAMEPTR_FLAGS="-fno-omit-frame-pointer"
fi
MOZ_PGO_OPTIMIZE_FLAGS="-O3 $MOZ_FRAMEPTR_FLAGS"
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK $MOZ_FRAMEPTR_FLAGS"
MOZ_DEBUG_FLAGS="-g"
fi
@ -4617,6 +4619,7 @@ AC_SUBST(MOZ_OPTIMIZE)
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable generation of debug symbols

View File

@ -51,7 +51,7 @@ MOZILLA_INTERNAL_API = 1
# work around bug 408258
ifdef GNU_CC
ifneq ($(OS_ARCH), Darwin)
MODULE_OPTIMIZE_FLAGS = -O3 -fno-strict-aliasing
MODULE_OPTIMIZE_FLAGS = $(MOZ_OPTIMIZE_FLAGS) -fno-strict-aliasing
endif
endif