Bug 1186444 - part 1 - move uses of MODULE_OPTIMIZE_FLAGS to moz.build's CFLAGS; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Wed, 22 Jul 2015 11:04:32 -0400
changeset 257610 d320f4dabfd285e37b76b5d8bc7be2e9dc5b6874
parent 257609 7bf71f3a4465c056791ef79ba73b85b14dccb1dc
child 257611 4c1274a508bed4361deacfb39b206daedf991dc2
push id63683
push usernfroyd@mozilla.com
push dateThu, 13 Aug 2015 16:06:13 +0000
treeherdermozilla-inbound@4c1274a508be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1186444
milestone43.0a1
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 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.
config/Makefile.in
config/moz.build
gfx/cairo/cairo/src/Makefile.in
gfx/cairo/cairo/src/moz.build
gfx/cairo/libpixman/src/Makefile.in
gfx/cairo/libpixman/src/moz.build
memory/mozjemalloc/Makefile.in
memory/mozjemalloc/moz.build
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -5,20 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
 # a recursive rule for finding nsinstall and the Perl scripts.
 ifdef NSBUILDROOT
 override NSBUILDROOT :=
 endif
 
-ifdef GNU_CC
-MODULE_OPTIMIZE_FLAGS = -O3
-endif
-
 include $(topsrcdir)/config/config.mk
 
 # L10n jobs are doing make -C config manually before anything else,
 # and need nsinstall to be built as a consequence.
 ifdef COMPILE_ENVIRONMENT
 export:: host
 
 ifneq (WINNT,$(HOST_OS_ARCH))
--- a/config/moz.build
+++ b/config/moz.build
@@ -34,8 +34,11 @@ if CONFIG['MOZ_SHARED_ICU']:
 
 PYTHON_UNIT_TESTS += [
     'tests/test_mozbuild_reading.py',
     'tests/unit-expandlibs.py',
     'tests/unit-mozunit.py',
     'tests/unit-nsinstall.py',
     'tests/unit-printprereleasesuffix.py',
 ]
+
+if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:
+    CFLAGS += ['-O3']
--- a/gfx/cairo/cairo/src/Makefile.in
+++ b/gfx/cairo/cairo/src/Makefile.in
@@ -1,15 +1,9 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
-ifdef GNU_CC
-ifeq ($(OS_TARGET),Android)
-MODULE_OPTIMIZE_FLAGS = -O2
-endif
-endif
-
 INSTALL_TARGETS += cairo_features
 cairo_features_FILES := cairo-features.h
 cairo_features_DEST = $(DIST)/include/cairo
 cairo_features_TARGET := export
 
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -229,16 +229,21 @@ if CONFIG['GNU_CC']:
     if CONFIG['CLANG_CXX']:
         CFLAGS += [
             '-Wno-incompatible-pointer-types',
             '-Wno-tautological-compare',
             '-Wno-tautological-constant-out-of-range-compare',
             '-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':
     CFLAGS += CONFIG['MOZ_QT_CFLAGS']
     CXXFLAGS += CONFIG['MOZ_QT_CFLAGS']
 
 if CONFIG['MOZ_X11']:
     CFLAGS += CONFIG['XCFLAGS']
 
 if CONFIG['MOZ_ENABLE_CAIRO_FT']:
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -1,14 +1,10 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
-ifeq ($(OS_TARGET),Android)
-MODULE_OPTIMIZE_FLAGS = -O2
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 # The ARM asm functions here don't appreciate being called by functions
 # compiled with -mapcs-frame.  See bug 832752.
 CXXFLAGS := $(filter-out -mapcs-frame,$(CXXFLAGS))
 CFLAGS := $(filter-out -mapcs-frame,$(CFLAGS))
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -140,8 +140,12 @@ if CONFIG['GNU_CC']:
         '-Wno-missing-field-initializers',
     ]
     if CONFIG['CLANG_CXX']:
         CFLAGS += [
             '-Wno-incompatible-pointer-types',
             '-Wno-tautological-compare',
             '-Wno-tautological-constant-out-of-range-compare',
         ]
+
+# See bug 386897.
+if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
+    CFLAGS += ['-O2']
--- a/memory/mozjemalloc/Makefile.in
+++ b/memory/mozjemalloc/Makefile.in
@@ -4,16 +4,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 ifndef MOZ_JEMALLOC3
 # Force optimize mozjemalloc on --disable-optimize builds.
 # This works around the issue that the Android NDK's definition of ffs is
 # broken when compiling without optimization, while avoiding to add yet another
 # configure test.
 MOZ_OPTIMIZE = 1
-
-ifeq ($(OS_ARCH),SunOS)
-ifndef GNU_CC
-MODULE_OPTIMIZE_FLAGS = -xO5
-endif
-endif
 endif
 
--- a/memory/mozjemalloc/moz.build
+++ b/memory/mozjemalloc/moz.build
@@ -11,16 +11,21 @@ EXPORTS += [
 if not CONFIG['MOZ_JEMALLOC3']:
     SOURCES += [
         'jemalloc.c',
     ]
     Library('mozjemalloc')
     STATIC_LIBRARY_NAME = 'jemalloc'
     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
 # helps us catch memory errors.
 if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('release', 'esr'):
     DEFINES['MOZ_JEMALLOC_HARD_ASSERTS'] = True
 
 DEFINES['abort'] = 'moz_abort'
 
 DEFINES['MOZ_JEMALLOC_IMPL'] = True