From 020f3fd4d81b01408b27a581b3c0c54f1ab25a15 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 19 Mar 2014 21:55:00 -0400 Subject: [PATCH] Bug 979118 - Add global MMX_FLAGS, SSE_FLAGS and SSE2_FLAGS variables; r=glandium --- build/autoconf/config.status.m4 | 19 ++++++++++++++-- configure.in | 31 ++++++++++++++++++++++++++ content/base/src/moz.build | 7 +----- gfx/2d/moz.build | 11 +++------ gfx/angle/src/libGLESv2/moz.build | 3 +-- gfx/cairo/libpixman/src/moz.build | 9 +++----- gfx/qcms/moz.build | 10 ++++----- gfx/skia/generate_mozbuild.py | 14 ++++++------ gfx/skia/moz.build | 14 ++++++------ gfx/thebes/moz.build | 5 +---- gfx/ycbcr/moz.build | 10 ++------- intl/uconv/src/moz.build | 7 +----- media/libsoundtouch/src/moz.build | 10 ++------- media/libspeex_resampler/src/moz.build | 3 +-- media/libvpx/moz.build | 2 +- xpcom/string/src/moz.build | 7 +----- 16 files changed, 83 insertions(+), 79 deletions(-) diff --git a/build/autoconf/config.status.m4 b/build/autoconf/config.status.m4 index 8840a2c780024..06114364b69cf 100644 --- a/build/autoconf/config.status.m4 +++ b/build/autoconf/config.status.m4 @@ -11,24 +11,39 @@ dnl can mess around with things like: dnl AC_SOMETHING(foo,AC_SUBST(),bar) define([AC_SUBST], [ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])], +[ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])], [ifdef([AC_SUBST_$1], , [define([AC_SUBST_$1], )dnl AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl (''' $1 ''', r''' [$]$1 ''') AC_DIVERT_POP()dnl -])])]) +])])])]) dnl Like AC_SUBST, but makes the value available as a set in python, dnl with values got from the value of the environment variable, split on dnl whitespaces. define([AC_SUBST_SET], [ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])], +[ifdef([AC_SUBST_LIST$1], [m4_fatal([Cannot use AC_SUBST_LIST and AC_SUBST_SET on the same variable ($1)])], [ifdef([AC_SUBST_SET_$1], , [define([AC_SUBST_SET_$1], )dnl AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl (''' $1 ''', set(r''' [$]$1 '''.split())) AC_DIVERT_POP()dnl -])])]) +])])])]) + +dnl Like AC_SUBST, but makes the value available as a list in python, +dnl with values got from the value of the environment variable, split on +dnl whitespaces. +define([AC_SUBST_LIST], +[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])], +[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST_SET and AC_SUBST_LIST on the same variable ($1)])], +[ifdef([AC_SUBST_LIST_$1], , +[define([AC_SUBST_LIST_$1], )dnl +AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl + (''' $1 ''', list(r''' [$]$1 '''.split())) +AC_DIVERT_POP()dnl +])])])]) dnl Wrap AC_DEFINE to store values in a format suitable for python. dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h, diff --git a/configure.in b/configure.in index 9cdf33d7006b2..e6c0955ef5d38 100644 --- a/configure.in +++ b/configure.in @@ -1912,6 +1912,9 @@ case "$target" in fi TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"' + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" if test "x$lto_is_enabled" = "xyes"; then echo "Skipping -dead_strip because lto is enabled." @@ -2004,6 +2007,10 @@ ia64*-hpux*) fi TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" + MOZ_GFX_OPTIMIZE_MOBILE=1 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions" ;; @@ -2025,6 +2032,10 @@ ia64*-hpux*) MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK" fi + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" + TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' MOZ_MEMORY=1 @@ -2070,6 +2081,10 @@ ia64*-hpux*) DLL_PREFIX= IMPORT_LIB_SUFFIX=dll.a + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" + # We use mix of both POSIX and Win32 printf format across the tree, so format # warnings are useless on mingw. MOZ_C_SUPPORTS_WARNING(-Wno-, format, ac_c_has_wno_format) @@ -2271,6 +2286,9 @@ ia64*-hpux*) fi MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@' MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@)) -o $@' + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" ;; *-openbsd*) @@ -2286,6 +2304,9 @@ ia64*-hpux*) if test "$LIBRUNPATH"; then DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS" fi + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" ;; *-solaris*) @@ -2301,6 +2322,9 @@ ia64*-hpux*) CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__" CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef" LDFLAGS="-xildoff $LDFLAGS" + MMX_FLAGS="-xarch=mmx -xO4" + SSE_FLAGS="-xarch=sse" + SSE2_FLAGS="-xarch=ssei2 -xO4" if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then _SAVE_LDFLAGS=$LDFLAGS LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS" @@ -2364,6 +2388,9 @@ ia64*-hpux*) if test "$OS_RELEASE" = "5.3"; then AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES) fi + MMX_FLAGS="-mmmx" + SSE_FLAGS="-msse" + SSE2_FLAGS="-msse2" fi if test "$OS_RELEASE" = "5.5.1"; then AC_DEFINE(NEED_USLEEP_PROTOTYPE) @@ -2385,6 +2412,10 @@ ia64*-hpux*) esac +AC_SUBST_LIST(MMX_FLAGS) +AC_SUBST_LIST(SSE_FLAGS) +AC_SUBST_LIST(SSE2_FLAGS) + case "$target" in *-*linux*) # Includes linux-android diff --git a/content/base/src/moz.build b/content/base/src/moz.build index 5868ec29b7090..c7bb37fd8517a 100644 --- a/content/base/src/moz.build +++ b/content/base/src/moz.build @@ -51,12 +51,7 @@ if CONFIG['MOZ_WEBRTC']: # nsTextFragment.cpp if CONFIG['INTEL_ARCHITECTURE']: SOURCES += ['nsTextFragmentSSE2.cpp'] - if CONFIG['GNU_CC']: - # gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug - # 585538 comment 12.) - SOURCES['nsTextFragmentSSE2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['nsTextFragmentSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] EXPORTS.mozilla.dom += [ 'Attr.h', diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build index c779f914b8963..35e9130e0239d 100644 --- a/gfx/2d/moz.build +++ b/gfx/2d/moz.build @@ -90,14 +90,9 @@ if CONFIG['INTEL_ARCHITECTURE']: DEFINES['USE_SSE2'] = True # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. - if CONFIG['GNU_CC']: - SOURCES['BlurSSE2.cpp'].flags += ['-msse2'] - SOURCES['FilterProcessingSSE2.cpp'].flags += ['-msse2'] - SOURCES['ImageScalingSSE2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['BlurSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] - SOURCES['FilterProcessingSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] - SOURCES['ImageScalingSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['BlurSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['FilterProcessingSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['ImageScalingSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] UNIFIED_SOURCES += [ 'Blur.cpp', diff --git a/gfx/angle/src/libGLESv2/moz.build b/gfx/angle/src/libGLESv2/moz.build index 790dac0639099..432908d398898 100644 --- a/gfx/angle/src/libGLESv2/moz.build +++ b/gfx/angle/src/libGLESv2/moz.build @@ -172,8 +172,7 @@ SOURCES += ['renderer/' + src for src in [ 'VertexDeclarationCache.cpp', ]] -if CONFIG['GNU_CC']: - SOURCES['renderer/ImageSSE2.cpp'].flags += ['-msse2'] +SOURCES['renderer/ImageSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] # On Windows, we don't automatically get "lib" prepended, but we need it. LIBRARY_NAME = 'libGLESv2' diff --git a/gfx/cairo/libpixman/src/moz.build b/gfx/cairo/libpixman/src/moz.build index dc5d196ccec85..489d21b30752b 100644 --- a/gfx/cairo/libpixman/src/moz.build +++ b/gfx/cairo/libpixman/src/moz.build @@ -110,9 +110,9 @@ elif 'arm' in CONFIG['OS_TEST']: if use_mmx: DEFINES['USE_MMX'] = True SOURCES += ['pixman-mmx.c'] + SOURCES['pixman-mmx.c'].flags += CONFIG['MMX_FLAGS'] if CONFIG['GNU_CC']: SOURCES['pixman-mmx.c'].flags += [ - '-mmmx', '-Winline', '--param inline-unit-growth=10000', '--param large-function-growth=10000', @@ -122,12 +122,9 @@ if use_sse2: DEFINES['USE_SSE'] = True DEFINES['USE_SSE2'] = True SOURCES += ['pixman-sse2.c'] + SOURCES['pixman-sse2.c'].flags += CONFIG['SSE_FLAGS'] + CONFIG['SSE2_FLAGS'] if CONFIG['GNU_CC']: - SOURCES['pixman-sse2.c'].flags += [ - '-msse', - '-msse2', - '-Winline', - ] + SOURCES['pixman-sse2.c'].flags += ['-Winline'] if use_vmx: DEFINES['USE_VMX'] = True diff --git a/gfx/qcms/moz.build b/gfx/qcms/moz.build index e0683ac657c07..268c60401972f 100644 --- a/gfx/qcms/moz.build +++ b/gfx/qcms/moz.build @@ -40,9 +40,8 @@ elif 'ppc' in CONFIG['CPU_ARCH']: if use_sse1: SOURCES += ['transform-sse1.c'] - if CONFIG['GNU_CC']: - SOURCES['transform-sse1.c'].flags += ['-msse'] - elif CONFIG['SOLARIS_SUNPRO_CC']: + SOURCES['transform-sse1.c'].flags += CONFIG['SSE_FLAGS'] + if CONFIG['SOLARIS_SUNPRO_CC']: if '64' in CONFIG['OS_TEST']: # Sun Studio doesn't work correctly for x86 intristics # with -m64 and without optimization. @@ -52,9 +51,8 @@ if use_sse1: if use_sse2: SOURCES += ['transform-sse2.c'] - if CONFIG['GNU_CC']: - SOURCES['transform-sse2.c'].flags += ['-msse2'] - elif CONFIG['SOLARIS_SUNPRO_CC']: + SOURCES['transform-sse2.c'].flags += CONFIG['SSE2_FLAGS'] + if CONFIG['SOLARIS_SUNPRO_CC']: if '64' in CONFIG['OS_TEST']: # Sun Studio doesn't work correctly for x86 intristics # with -m64 and without optimization. diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py index f98b88d00c80a..077017588f2af 100755 --- a/gfx/skia/generate_mozbuild.py +++ b/gfx/skia/generate_mozbuild.py @@ -80,14 +80,14 @@ DEFINES['GR_DLL'] = 1 if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']: - SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-msse2'] + SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3'] - SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += ['-msse2'] + SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC'] and CONFIG['BUILD_ARM_NEON']: DEFINES['__ARM_HAVE_OPTIONAL_NEON_SUPPORT'] = 1 DEFINES['USE_ANDROID_NDK_CPU_FEATURES'] = 0 diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build index b9daab0bde8a2..1af5e753bbacc 100644 --- a/gfx/skia/moz.build +++ b/gfx/skia/moz.build @@ -881,14 +881,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': DEFINES['GR_DLL'] = 1 if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']: - SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += ['-msse2'] + SOURCES['trunk/src/opts/SkBitmapFilter_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] SOURCES['trunk/src/opts/SkBitmapProcState_opts_SSSE3.cpp'].flags += ['-mssse3'] - SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += ['-msse2'] - SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += ['-msse2'] + SOURCES['trunk/src/opts/SkBlitRect_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBlitRow_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkBlurImage_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkMorphology_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] + SOURCES['trunk/src/opts/SkUtils_opts_SSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC'] and CONFIG['BUILD_ARM_NEON']: DEFINES['__ARM_HAVE_OPTIONAL_NEON_SUPPORT'] = 1 DEFINES['USE_ANDROID_NDK_CPU_FEATURES'] = 0 diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index 054aa533268e0..9493632c45a31 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -202,10 +202,7 @@ if CONFIG['INTEL_ARCHITECTURE']: SOURCES += ['gfxAlphaRecoverySSE2.cpp'] # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. - if CONFIG['GNU_CC']: - SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] SOURCES += [ # Includes mac system header conflicting with point/size, diff --git a/gfx/ycbcr/moz.build b/gfx/ycbcr/moz.build index 2d643c4b45e74..bb3ff6849818d 100644 --- a/gfx/ycbcr/moz.build +++ b/gfx/ycbcr/moz.build @@ -24,10 +24,7 @@ if CONFIG['INTEL_ARCHITECTURE']: # These files use MMX and SSE2 intrinsics, so they need special compile flags # on some compilers. SOURCES += ['yuv_convert_sse2.cpp'] - if CONFIG['GNU_CC']: - SOURCES['yuv_convert_sse2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['yuv_convert_sse2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['yuv_convert_sse2.cpp'].flags += CONFIG['SSE2_FLAGS'] # MSVC doesn't support MMX when targeting AMD64. if CONFIG['_MSC_VER']: @@ -37,10 +34,7 @@ if CONFIG['INTEL_ARCHITECTURE']: ] else: SOURCES += ['yuv_convert_mmx.cpp'] - if CONFIG['GNU_CC']: - SOURCES['yuv_convert_mmx.cpp'].flags += ['-mmmx'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['yuv_convert_mmx.cpp'].flags += ['-xarch=mmx', '-xO4'] + SOURCES['yuv_convert_mmx.cpp'].flags += CONFIG['MMX_FLAGS'] if CONFIG['_MSC_VER']: if CONFIG['OS_TEST'] == 'x86_64': diff --git a/intl/uconv/src/moz.build b/intl/uconv/src/moz.build index fbf3c7f73c3df..eb966058f559e 100644 --- a/intl/uconv/src/moz.build +++ b/intl/uconv/src/moz.build @@ -202,12 +202,7 @@ UNIFIED_SOURCES += [ if CONFIG['INTEL_ARCHITECTURE']: SOURCES += ['nsUTF8ToUnicodeSSE2.cpp'] - if CONFIG['GNU_CC']: - # nsUTF8ToUnicodeSSE2.cpp uses SSE2 intrinsics, so we need to pass -msse2 if - # we're using gcc. (See bug 585538 comment 12.) - SOURCES['nsUTF8ToUnicodeSSE2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['nsUTF8ToUnicodeSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['nsUTF8ToUnicodeSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] MSVC_ENABLE_PGO = True diff --git a/media/libsoundtouch/src/moz.build b/media/libsoundtouch/src/moz.build index 7a43e357b6c0a..883f9c317b840 100644 --- a/media/libsoundtouch/src/moz.build +++ b/media/libsoundtouch/src/moz.build @@ -24,16 +24,10 @@ UNIFIED_SOURCES += [ if CONFIG['INTEL_ARCHITECTURE']: if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']: SOURCES += ['sse_optimized.cpp'] - if CONFIG['GNU_CC']: - SOURCES['sse_optimized.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['sse_optimized.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['sse_optimized.cpp'].flags += CONFIG['SSE2_FLAGS'] else: SOURCES += ['mmx_optimized.cpp'] - if CONFIG['GNU_CC']: - SOURCES['mmx_optimized.cpp'].flags += ['-mmmx'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['mmx_optimized.cpp'].flags += ['-xarch=mmx', '-xO4'] + SOURCES['mmx_optimized.cpp'].flags += CONFIG['MMX_FLAGS'] MSVC_ENABLE_PGO = True if CONFIG['GKMEDIAS_SHARED_LIBRARY']: diff --git a/media/libspeex_resampler/src/moz.build b/media/libspeex_resampler/src/moz.build index 4056a6c8e4c69..4eadd8f258ce2 100644 --- a/media/libspeex_resampler/src/moz.build +++ b/media/libspeex_resampler/src/moz.build @@ -39,8 +39,7 @@ else: if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['OS_TARGET'] != 'Android': DEFINES['_USE_SSE'] = True DEFINES['_USE_SSE2'] = True - if CONFIG['GNU_CC']: - SOURCES['resample.c'].flags += ['-msse2'] + SOURCES['resample.c'].flags += CONFIG['SSE2_FLAGS'] # Suppress warnings in third-party code. if CONFIG['GNU_CC']: diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build index 929bab25fb99a..4e97a4865686c 100644 --- a/media/libvpx/moz.build +++ b/media/libvpx/moz.build @@ -92,7 +92,7 @@ if not CONFIG['_MSC_VER']: for f in SOURCES: if f.endswith('.c'): if 'sse2' in f: - SOURCES[f].flags += ['-msse2'] + SOURCES[f].flags += CONFIG['SSE2_FLAGS'] if 'ssse3' in f: SOURCES[f].flags += ['-mssse3'] if 'avx2' in f: diff --git a/xpcom/string/src/moz.build b/xpcom/string/src/moz.build index 11863a0efe7d2..50f33162ac9ca 100644 --- a/xpcom/string/src/moz.build +++ b/xpcom/string/src/moz.build @@ -20,12 +20,7 @@ UNIFIED_SOURCES += [ # nsUTF8Utils.cpp. if CONFIG['INTEL_ARCHITECTURE']: SOURCES += ['nsUTF8UtilsSSE2.cpp'] - if CONFIG['GNU_CC']: - # gcc requires -msse2 on nsUTF8UtilsSSE2.cpp since it uses SSE2 intrinsics. - # (See bug 585538 comment 12.) - SOURCES['nsUTF8UtilsSSE2.cpp'].flags += ['-msse2'] - if CONFIG['SOLARIS_SUNPRO_CXX']: - SOURCES['nsUTF8UtilsSSE2.cpp'].flags += ['-xarch=sse2', '-xO4'] + SOURCES['nsUTF8UtilsSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] LOCAL_INCLUDES += [ '/mfbt/double-conversion',