From 73e9c2d6c72e321724d33e185d11e4e88453c153 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 29 Aug 2011 07:34:02 +0200 Subject: [PATCH] Bug 676252 part 1 - Don't use $(OBJ_SUFFIX) before including config.mk. r=ted --- build/unix/elfhack/Makefile.in | 21 ++++++++++----------- content/base/src/Makefile.in | 23 ++++++++++++----------- gfx/thebes/Makefile.in | 23 ++++++++++++----------- gfx/ycbcr/Makefile.in | 29 +++++++++++++++-------------- intl/uconv/src/Makefile.in | 22 ++++++++++++---------- media/libvpx/Makefile.in | 13 +++++-------- xpcom/string/src/Makefile.in | 6 ++++-- 7 files changed, 70 insertions(+), 67 deletions(-) diff --git a/build/unix/elfhack/Makefile.in b/build/unix/elfhack/Makefile.in index 18cfccfaa6a7..d759c0c18ff6 100644 --- a/build/unix/elfhack/Makefile.in +++ b/build/unix/elfhack/Makefile.in @@ -71,13 +71,22 @@ endif CSRCS := \ inject/$(CPU).c \ inject/$(CPU)-noinit.c \ + test.c \ $(NULL) -libs:: $(CSRCS:.c=.$(OBJ_SUFFIX)) +ifndef CROSS_COMPILE +CSRCS += dummy.c +endif WRAP_MALLOC_CFLAGS= WRAP_MALLOC_LIB= +# need this to suppress errors due to /usr/include/linux/byteorder/swab.h +# on mozilla buildbots +OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS)) + +include $(topsrcdir)/config/rules.mk + test$(DLL_SUFFIX): test.$(OBJ_SUFFIX) elfhack $(CSRCS:.c=.$(OBJ_SUFFIX)) $(MKSHLIB) $(LDFLAGS) $< @echo === @@ -94,8 +103,6 @@ test$(DLL_SUFFIX): test.$(OBJ_SUFFIX) elfhack $(CSRCS:.c=.$(OBJ_SUFFIX)) .PRECIOUS: test$(DLL_SUFFIX) -CSRCS += test.c - GARBAGE += test$(DLL_SUFFIX) test$(DLL_SUFFIX).bak libs:: test$(DLL_SUFFIX) @@ -108,8 +115,6 @@ libs:: dummy # Will either crash or return exit code 1 if elfhack is broken LD_LIBRARY_PATH=$(CURDIR) $(CURDIR)/dummy -CSRCS += dummy.c - GARBAGE += dummy endif @@ -121,12 +126,6 @@ inject/%.c: inject.c | inject GARBAGE_DIRS += inject -# need this to suppress errors due to /usr/include/linux/byteorder/swab.h -# on mozilla buildbots -OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS)) - -include $(topsrcdir)/config/rules.mk - inject/%.$(OBJ_SUFFIX): DEFINES += -DBITS=$(if $(HAVE_64BIT_OS),64,32) inject/%.$(OBJ_SUFFIX): CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS)) inject/$(CPU)-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in index 688b787baeab..0d85cb8b28fd 100644 --- a/content/base/src/Makefile.in +++ b/content/base/src/Makefile.in @@ -160,18 +160,7 @@ CPPSRCS = \ # Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for # nsTextFragment.cpp ifneq (,$(INTEL_ARCHITECTURE)) - CPPSRCS += nsTextFragmentSSE2.cpp - -# gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug -# 585538 comment 12.) -ifdef GNU_CC -nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 -endif - -ifdef SOLARIS_SUNPRO_CXX -nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-xarch=sse2 -xO4 -endif endif GQI_SRCS = contentbase.gqi @@ -220,3 +209,15 @@ INCLUDES += \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT + +# gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug +# 585538 comment 12.) +ifneq (,$(INTEL_ARCHITECTURE)) +ifdef GNU_CC +nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 +endif + +ifdef SOLARIS_SUNPRO_CXX +nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-xarch=sse2 -xO4 +endif +endif diff --git a/gfx/thebes/Makefile.in b/gfx/thebes/Makefile.in index c32c4dc02433..6eaeacf9a748 100644 --- a/gfx/thebes/Makefile.in +++ b/gfx/thebes/Makefile.in @@ -179,19 +179,8 @@ CPPSRCS = \ $(NULL) # Are we targeting x86 or x64? If so, build gfxAlphaRecoverySSE2.cpp. -# The file uses SSE2 intrinsics, so it needs special compile flags on some -# compilers. ifneq (,$(INTEL_ARCHITECTURE)) CPPSRCS += gfxAlphaRecoverySSE2.cpp - -ifdef GNU_CC -gfxAlphaRecoverySSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 -endif - -ifdef SOLARIS_SUNPRO_CXX -gfxAlphaRecoverySSE2.$(OBJ_SUFFIX): OS_CXXFLAGS += -xarch=sse2 -xO4 -endif - endif SHARED_LIBRARY_LIBS += \ @@ -400,3 +389,15 @@ endif ifeq ($(MOZ_WIDGET_TOOLKIT),qt) CXXFLAGS += $(CAIRO_FT_CFLAGS) $(MOZ_PANGO_CFLAGS) endif + +# The file uses SSE2 intrinsics, so it needs special compile flags on some +# compilers. +ifneq (,$(INTEL_ARCHITECTURE)) +ifdef GNU_CC +gfxAlphaRecoverySSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 +endif + +ifdef SOLARIS_SUNPRO_CXX +gfxAlphaRecoverySSE2.$(OBJ_SUFFIX): OS_CXXFLAGS += -xarch=sse2 -xO4 +endif +endif diff --git a/gfx/ycbcr/Makefile.in b/gfx/ycbcr/Makefile.in index 01ea33446a0e..05eb9c4ee962 100644 --- a/gfx/ycbcr/Makefile.in +++ b/gfx/ycbcr/Makefile.in @@ -25,8 +25,7 @@ CPPSRCS = yuv_convert.cpp \ $(NULL) # Are we targeting x86 or x64? If so, build yuv_convert_mmx.cpp and -# yuv_convert_sse2.cpp. These files use MMX and SSE2 intrinsics, so they need -# special compile flags on some compilers. +# yuv_convert_sse2.cpp. ifneq (,$(INTEL_ARCHITECTURE)) CPPSRCS += yuv_convert_sse2.cpp @@ -38,20 +37,8 @@ endif else CPPSRCS += yuv_convert_mmx.cpp endif - -ifdef GNU_CC -yuv_convert_mmx.$(OBJ_SUFFIX): CXXFLAGS += -mmmx -yuv_convert_sse2.$(OBJ_SUFFIX): CXXFLAGS += -msse2 endif -ifdef SOLARIS_SUNPRO_CXX -yuv_convert_mmx.$(OBJ_SUFFIX): CXXFLAGS += -xarch=mmx -xO4 -yuv_convert_sse2.$(OBJ_SUFFIX): CXXFLAGS += -xarch=sse2 -xO4 -endif - -endif - - ifdef _MSC_VER ifeq ($(OS_TEST),x86_64) ifeq (1400,$(_MSC_VER)) @@ -96,3 +83,17 @@ endif endif include $(topsrcdir)/config/rules.mk + +# These files use MMX and SSE2 intrinsics, so they need special compile flags +# on some compilers. +ifneq (,$(INTEL_ARCHITECTURE)) +ifdef GNU_CC +yuv_convert_mmx.$(OBJ_SUFFIX): CXXFLAGS += -mmmx +yuv_convert_sse2.$(OBJ_SUFFIX): CXXFLAGS += -msse2 +endif + +ifdef SOLARIS_SUNPRO_CXX +yuv_convert_mmx.$(OBJ_SUFFIX): CXXFLAGS += -xarch=mmx -xO4 +yuv_convert_sse2.$(OBJ_SUFFIX): CXXFLAGS += -xarch=sse2 -xO4 +endif +endif diff --git a/intl/uconv/src/Makefile.in b/intl/uconv/src/Makefile.in index 74121cc193f3..bbabcdf677ec 100644 --- a/intl/uconv/src/Makefile.in +++ b/intl/uconv/src/Makefile.in @@ -74,16 +74,6 @@ CPPSRCS = \ # version of nsUTF8ToUnicodeSSE2.cpp. ifneq (,$(INTEL_ARCHITECTURE)) CPPSRCS += nsUTF8ToUnicodeSSE2.cpp - -# nsUTF8ToUnicodeSSE2.cpp uses SSE2 intrinsics, so we need to pass -msse2 if -# we're using gcc. (See bug 585538 comment 12.) -ifdef GNU_CC -nsUTF8ToUnicodeSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 -endif - -ifdef SOLARIS_SUNPRO_CXX -nsUTF8ToUnicodeSSE2.$(OBJ_SUFFIX): OS_CXXFLAGS += -xarch=sse2 -xO4 -endif endif LOCAL_INCLUDES = -I$(srcdir)/../util \ @@ -107,3 +97,15 @@ SHARED_LIBRARY_LIBS += \ $(NULL) include $(topsrcdir)/config/rules.mk + +ifneq (,$(INTEL_ARCHITECTURE)) +# nsUTF8ToUnicodeSSE2.cpp uses SSE2 intrinsics, so we need to pass -msse2 if +# we're using gcc. (See bug 585538 comment 12.) +ifdef GNU_CC +nsUTF8ToUnicodeSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2 +endif + +ifdef SOLARIS_SUNPRO_CXX +nsUTF8ToUnicodeSSE2.$(OBJ_SUFFIX): OS_CXXFLAGS += -xarch=sse2 -xO4 +endif +endif diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in index c4791945c0a7..2715d81baef4 100644 --- a/media/libvpx/Makefile.in +++ b/media/libvpx/Makefile.in @@ -299,16 +299,8 @@ GARBAGE += $(VPX_CONVERTED_ASFILES) %.asm.$(ASM_SUFFIX): %.asm $(VPX_AS_CONVERSION) < $< > $@ - -vpx_asm_offsets.asm: vpx_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM) - ./$(HOST_PROGRAM) rvds $< | $(VPX_AS_CONVERSION) > $@ - else ASFILES += $(VPX_ASFILES) - -vpx_asm_offsets.asm: vpx_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM) - ./$(HOST_PROGRAM) rvds $< > $@ - endif GARBAGE += vpx_asm_offsets.$(OBJ_SUFFIX) vpx_asm_offsets.asm @@ -326,3 +318,8 @@ filter_c.o: filter_c.c Makefile.in $(CC) -o $@ -c $(patsubst -xO[45],-xO3,$(COMPILE_CFLAGS)) $< endif endif + +ifdef VPX_ARM_ASM +vpx_asm_offsets.asm: vpx_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM) + ./$(HOST_PROGRAM) rvds $< $(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@ +endif diff --git a/xpcom/string/src/Makefile.in b/xpcom/string/src/Makefile.in index b1b60f18747f..74c95234a9e5 100644 --- a/xpcom/string/src/Makefile.in +++ b/xpcom/string/src/Makefile.in @@ -74,7 +74,11 @@ FORCE_USE_PIC = 1 # nsUTF8Utils.cpp. ifneq (,$(INTEL_ARCHITECTURE)) CPPSRCS += nsUTF8UtilsSSE2.cpp +endif +include $(topsrcdir)/config/rules.mk + +ifneq (,$(INTEL_ARCHITECTURE)) # gcc requires -msse2 on nsUTF8UtilsSSE2.cpp since it uses SSE2 intrinsics. # (See bug 585538 comment 12.) ifdef GNU_CC @@ -86,6 +90,4 @@ nsUTF8UtilsSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-xarch=sse2 -xO4 endif endif -include $(topsrcdir)/config/rules.mk - DEFINES += -D_IMPL_NS_COM