Bug 1403346 - Convert sse flags filtering in browser/app/Makefile.in to mozbuild. draft
authorChris Manchester <cmanchester@mozilla.com>
Wed, 25 Oct 2017 15:12:10 -0700
changeset 686524 9d602202f975805b166a8a7d4e58f267ba5400b6
parent 686523 e63871b37a538773c4f6f15be916da697ae13e63
child 686525 920f16dc595f683229a29596e53be403d330178b
push id86198
push userbmo:cmanchester@mozilla.com
push dateWed, 25 Oct 2017 22:13:37 +0000
bugs1403346
milestone58.0a1
Bug 1403346 - Convert sse flags filtering in browser/app/Makefile.in to mozbuild. MozReview-Commit-ID: D10cPf6v0d2
browser/app/Makefile.in
browser/app/moz.build
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -21,19 +21,17 @@ endif
 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
 # If we are trying to show an error dialog about the lack of SSE2 support,
 # make sure that code itself doesn't use SSE2.
 ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
-CXXFLAGS := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXXFLAGS))
 CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
-CXXFLAGS += -mno-sse -mno-sse2 -mfpmath=387
 CXX += -march=pentiumpro
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 # Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
 # (this dependency should really be just for firefox.exe, not other targets)
 # Note the manifest file exists in the tree, so we use the explicit filename
 # here.
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -112,12 +112,18 @@ if CONFIG['MOZ_LINKER']:
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']
 
 if CONFIG['MOZ_GPSD']:
     DEFINES['MOZ_GPSD'] = True
 
 if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
     DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
+    COMPILE_FLAGS['OS_CXXFLAGS'] = [
+        f for f in COMPILE_FLAGS.get('OS_CXXFLAGS', [])
+        if not f.startswith('-march=') and f not in ('-msse', '-msse2', '-mfpmath=sse')
+    ] + [
+        '-mno-sse', '-mno-sse2', '-mfpmath=387',
+    ]
 
 for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
     DEFINES[icon.upper() + '_ICO'] = '"%s/%s/%s.ico"' % (
         TOPSRCDIR, CONFIG['MOZ_BRANDING_DIRECTORY'], icon)