Bug 1186444 - part 1 - move uses of MODULE_OPTIMIZE_FLAGS to moz.build's CFLAGS; r=mshal

Now that we have moz.build, we can be guaranteed that any flags we add
in moz.build will be added after everything else has been setup.  So any
uses of MODULE_OPTIMIZE_FLAGS can be moved to moz.build's
CFLAGS/CXXFLAGS without any unusual repercussions.  We do have to verify
that MOZ_OPTIMIZE is in effect, though.
This commit is contained in:
Nathan Froyd 2015-07-22 11:04:32 -04:00
parent f3451f3618
commit c0be14cb69
8 changed files with 17 additions and 20 deletions

View File

@ -10,10 +10,6 @@ ifdef NSBUILDROOT
override NSBUILDROOT := override NSBUILDROOT :=
endif endif
ifdef GNU_CC
MODULE_OPTIMIZE_FLAGS = -O3
endif
include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/config.mk
# L10n jobs are doing make -C config manually before anything else, # L10n jobs are doing make -C config manually before anything else,

View File

@ -39,3 +39,6 @@ PYTHON_UNIT_TESTS += [
'tests/unit-nsinstall.py', 'tests/unit-nsinstall.py',
'tests/unit-printprereleasesuffix.py', 'tests/unit-printprereleasesuffix.py',
] ]
if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O3']

View File

@ -2,12 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
ifdef GNU_CC
ifeq ($(OS_TARGET),Android)
MODULE_OPTIMIZE_FLAGS = -O2
endif
endif
INSTALL_TARGETS += cairo_features INSTALL_TARGETS += cairo_features
cairo_features_FILES := cairo-features.h cairo_features_FILES := cairo-features.h
cairo_features_DEST = $(DIST)/include/cairo cairo_features_DEST = $(DIST)/include/cairo

View File

@ -234,6 +234,11 @@ if CONFIG['GNU_CC']:
'-Wno-error=uninitialized', '-Wno-error=uninitialized',
] ]
# See bug 386897.
if CONFIG['GNU_CC'] and CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O2']
CXXFLAGS += ['-O2']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt': if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
CFLAGS += CONFIG['MOZ_QT_CFLAGS'] CFLAGS += CONFIG['MOZ_QT_CFLAGS']
CXXFLAGS += CONFIG['MOZ_QT_CFLAGS'] CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']

View File

@ -2,10 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
ifeq ($(OS_TARGET),Android)
MODULE_OPTIMIZE_FLAGS = -O2
endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
# The ARM asm functions here don't appreciate being called by functions # The ARM asm functions here don't appreciate being called by functions

View File

@ -145,3 +145,7 @@ if CONFIG['GNU_CC']:
'-Wno-tautological-compare', '-Wno-tautological-compare',
'-Wno-tautological-constant-out-of-range-compare', '-Wno-tautological-constant-out-of-range-compare',
] ]
# See bug 386897.
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O2']

View File

@ -9,11 +9,5 @@ ifndef MOZ_JEMALLOC3
# broken when compiling without optimization, while avoiding to add yet another # broken when compiling without optimization, while avoiding to add yet another
# configure test. # configure test.
MOZ_OPTIMIZE = 1 MOZ_OPTIMIZE = 1
ifeq ($(OS_ARCH),SunOS)
ifndef GNU_CC
MODULE_OPTIMIZE_FLAGS = -xO5
endif
endif
endif endif

View File

@ -16,6 +16,11 @@ if not CONFIG['MOZ_JEMALLOC3']:
STATIC_LIBRARY_NAME = 'jemalloc' STATIC_LIBRARY_NAME = 'jemalloc'
FORCE_STATIC_LIB = True FORCE_STATIC_LIB = True
# See bug 422055.
if CONFIG['OS_ARCH'] == 'SunOS' and not CONFIG['GNU_CC'] \
and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-xO5']
# For non release/esr builds, enable (some) fatal jemalloc assertions. This # For non release/esr builds, enable (some) fatal jemalloc assertions. This
# helps us catch memory errors. # helps us catch memory errors.
if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('release', 'esr'): if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('release', 'esr'):