bug 1248016 - make ASFILES rules work with .s/.asm, get rid of ASM_SUFFIX. r?mshal draft
authorTed Mielczarek <ted@mielczarek.org>
Tue, 01 Mar 2016 13:47:19 -0500
changeset 336544 d7eddb71b050e0576e783c6ce8c67f66cfd88e13
parent 335409 9da51cb4974e03cdd8fa45a34086fe1033abfeaf
child 336547 09e174884822554810d6a049d09d5f30529d80ab
push id12111
push usertmielczarek@mozilla.com
push dateThu, 03 Mar 2016 17:47:07 +0000
reviewersmshal
bugs1248016
milestone47.0a1
bug 1248016 - make ASFILES rules work with .s/.asm, get rid of ASM_SUFFIX. r?mshal MozReview-Commit-ID: 1MK0Kud51vR
config/rules.mk
js/src/old-configure.in
media/ffvpx/libavcodec/x86/Makefile.in
media/ffvpx/libavutil/x86/Makefile.in
media/libav/Makefile.in
media/libav/libavutil/x86/Makefile.in
media/libjpeg/Makefile.in
media/libopus/Makefile.in
media/libopus/moz.build
media/libtheora/Makefile.in
media/libtheora/moz.build
media/libvpx/Makefile.in
media/libvpx/moz.build
old-configure.in
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -231,17 +231,18 @@ TARGETS			= $(LIBRARY) $(SHARED_LIBRARY)
 endif
 
 COBJS = $(notdir $(CSRCS:.c=.$(OBJ_SUFFIX)))
 SOBJS = $(notdir $(SSRCS:.S=.$(OBJ_SUFFIX)))
 # CPPSRCS can have different extensions (eg: .cpp, .cc)
 CPPOBJS = $(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(CPPSRCS))))
 CMOBJS = $(notdir $(CMSRCS:.m=.$(OBJ_SUFFIX)))
 CMMOBJS = $(notdir $(CMMSRCS:.mm=.$(OBJ_SUFFIX)))
-ASOBJS = $(notdir $(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
+# ASFILES can have different extensions (.s, .asm)
+ASOBJS = $(notdir $(addsuffix .$(OBJ_SUFFIX),$(basename $(ASFILES))))
 RSOBJS = $(addprefix lib,$(notdir $(RSSRCS:.rs=.$(LIB_SUFFIX))))
 ifndef OBJS
 _OBJS = $(COBJS) $(SOBJS) $(CPPOBJS) $(CMOBJS) $(CMMOBJS) $(ASOBJS) $(RSOBJS)
 OBJS = $(strip $(_OBJS))
 endif
 
 HOST_COBJS = $(addprefix host_,$(notdir $(HOST_CSRCS:.c=.$(OBJ_SUFFIX))))
 # HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -749,17 +749,16 @@ AR_EXTRACT='$(AR) x'
 AR_DELETE='$(AR) d'
 AS='$(CC)'
 AS_DASH_C_FLAG='-c'
 DLL_PREFIX=lib
 LIB_PREFIX=lib
 DLL_SUFFIX=.so
 OBJ_SUFFIX=o
 LIB_SUFFIX=a
-ASM_SUFFIX=s
 IMPORT_LIB_SUFFIX=
 DIRENT_INO=d_ino
 MOZ_USER_DIR=".mozilla"
 
 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
 
 USE_DEPENDENT_LIBS=1
 
@@ -1530,17 +1529,16 @@ ia64*-hpux*)
         AR='lib'
         AR_FLAGS='-NOLOGO -OUT:$@'
         AR_EXTRACT=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
         PKG_SKIP_STRIP=1
         XARGS=xargs
         DOXYGEN=:
-        ASM_SUFFIX=asm
         OBJ_SUFFIX=obj
         LIB_SUFFIX=lib
         DLL_PREFIX=
         LIB_PREFIX=
         IMPORT_LIB_SUFFIX=lib
         MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
         MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
         dnl Set subsystem version 5 for Windows XP.
@@ -3555,17 +3553,16 @@ AC_SUBST(DSO_PIC_CFLAGS)
 AC_SUBST(DSO_LDOPTS)
 AC_SUBST(LIB_PREFIX)
 AC_SUBST(DLL_PREFIX)
 AC_SUBST(DLL_SUFFIX)
 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
 AC_SUBST(LIB_SUFFIX)
 AC_SUBST(OBJ_SUFFIX)
 AC_SUBST(BIN_SUFFIX)
-AC_SUBST(ASM_SUFFIX)
 AC_SUBST(IMPORT_LIB_SUFFIX)
 AC_SUBST(USE_N32)
 AC_SUBST(CC_VERSION)
 AC_SUBST(CXX_VERSION)
 AC_SUBST(MSMANIFEST_TOOL)
 AC_SUBST(MOZ_LINKER)
 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
--- a/media/ffvpx/libavcodec/x86/Makefile.in
+++ b/media/ffvpx/libavcodec/x86/Makefile.in
@@ -1,7 +1,7 @@
 #
 # 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/.
 
 AS=$(FFVPX_AS)
-ASM_SUFFIX=asm
+
--- a/media/ffvpx/libavutil/x86/Makefile.in
+++ b/media/ffvpx/libavutil/x86/Makefile.in
@@ -1,7 +1,6 @@
 #
 # 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/.
 
 AS=$(FFVPX_AS)
-ASM_SUFFIX=asm
--- a/media/libav/Makefile.in
+++ b/media/libav/Makefile.in
@@ -1,7 +1,6 @@
 #
 # 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/.
 
 AS=$(LIBAV_FFT_AS)
-ASM_SUFFIX=asm
--- a/media/libav/libavutil/x86/Makefile.in
+++ b/media/libav/libavutil/x86/Makefile.in
@@ -1,7 +1,6 @@
 #
 # 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/.
 
 AS=$(LIBAV_FFT_AS)
-ASM_SUFFIX=asm
--- a/media/libjpeg/Makefile.in
+++ b/media/libjpeg/Makefile.in
@@ -1,10 +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/.
 
 AS=$(LIBJPEG_TURBO_AS)
-ASM_SUFFIX=asm
 
 include $(topsrcdir)/config/rules.mk
 
--- a/media/libopus/Makefile.in
+++ b/media/libopus/Makefile.in
@@ -2,20 +2,20 @@
 # 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/.
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef GNU_AS
 ifeq ($(CPU_ARCH),arm)
 
-celt_pitch_xcorr_arm-gnu.$(ASM_SUFFIX): celt/arm/armopts-gnu.S
+celt_pitch_xcorr_arm-gnu.s: celt/arm/armopts-gnu.S
 
 # armopts needs a specific rule, because arm2gnu.pl will always add the .S
 # suffix when translating the files that include it.
 celt/arm/armopts-gnu.S: celt/arm/armopts.s $(call mkdir_deps,celt/arm) $(GLOBAL_DEPS)
 	$(PERL) $(srcdir)/celt/arm/arm2gnu.pl < $< > $@
-# For all others, we can use an implicit rule with the configured $(ASM_SUFFIX).
-%-gnu.$(ASM_SUFFIX): celt/arm/%.s $(GLOBAL_DEPS)
+# For all others, we can use an implicit rule
+%-gnu.s: celt/arm/%.s $(GLOBAL_DEPS)
 	$(PERL) $(srcdir)/celt/arm/arm2gnu.pl < $< > $@
 
 endif
 endif
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -86,17 +86,17 @@ else:
     ]
     UNIFIED_SOURCES += silk_sources_fixed
 # for webrtc
     UNIFIED_SOURCES += opus_sources_float
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
     SOURCES += celt_sources_arm
     SOURCES += [
-        '!celt_pitch_xcorr_arm-gnu.%s' % CONFIG['ASM_SUFFIX']
+        '!celt_pitch_xcorr_arm-gnu.s'
     ]
     # -Os is significantly slower, enable -O3 unless optimization is disabled
     if CONFIG['MOZ_OPTIMIZE']:
         CFLAGS += [
             '-O3',
         ]
         CXXFLAGS += [
             '-O3',
--- a/media/libtheora/Makefile.in
+++ b/media/libtheora/Makefile.in
@@ -1,24 +1,24 @@
 # 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_AS
 ifeq ($(CPU_ARCH),arm)
 
-armfrag-gnu.$(ASM_SUFFIX): armopts-gnu.S
-armidct-gnu.$(ASM_SUFFIX): armopts-gnu.S
-armloop-gnu.$(ASM_SUFFIX): armopts-gnu.S
+armfrag-gnu.s: armopts-gnu.S
+armidct-gnu.s: armopts-gnu.S
+armloop-gnu.s: armopts-gnu.S
 
 # armopts needs a specific rule, because arm2gnu.pl will always add the .S
 # suffix when translating the files that include it.
 armopts-gnu.S: lib/arm/armopts.s
 	$(PERL) $(srcdir)/lib/arm/arm2gnu.pl < $< > $@
-# For all others, we can use an implicit rule with the configured $(ASM_SUFFIX).
-%-gnu.$(ASM_SUFFIX): lib/arm/%.s
+# For all others, we can use an implicit rule
+%-gnu.s: lib/arm/%.s
 	$(PERL) $(srcdir)/lib/arm/arm2gnu.pl < $< > $@
 
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/media/libtheora/moz.build
+++ b/media/libtheora/moz.build
@@ -86,17 +86,17 @@ if CONFIG['GNU_AS']:
                     'OC_ARM_ASM_MEDIA',
                     'OC_ARM_ASM_NEON'):
             DEFINES[var] = True
         # The Android NDK doesn't pre-define anything to indicate the OS it's
         # on, so do it for them.
         if CONFIG['OS_TARGET'] == 'Android':
             DEFINES['__linux__'] = True
 
-        SOURCES += [ '!%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
+        SOURCES += [ '!%s.s' % f for f in [
             'armbits-gnu',
             'armfrag-gnu',
             'armidct-gnu',
             'armloop-gnu',
         ]]
 
         # These flags are a lie; they're just used to enable the requisite
         # opcodes; actual arch detection is done at runtime.
--- a/media/libvpx/Makefile.in
+++ b/media/libvpx/Makefile.in
@@ -1,26 +1,25 @@
 # 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/.
 
 # Set up the libvpx assembler config.
 
 AS=$(VPX_AS)
-ASM_SUFFIX=$(VPX_ASM_SUFFIX)
 
 ifdef VPX_ARM_ASM
 
 ifdef VPX_AS_CONVERSION
 # The ARM asm is written in ARM RVCT syntax, but we actually build it with
 # gas using GNU syntax. Add some rules to perform the conversion.
 
 GENERATED_DIRS += $(dir $(ASFILES))
 
-%.asm.$(ASM_SUFFIX): %.asm $(ASM_OFFSETS)
+%.asm.s: %.asm $(ASM_OFFSETS)
 	$(VPX_AS_CONVERSION) < $< > $@
 
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 # Workaround a bug of Sun Studio (CR 6963410)
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -29,17 +29,17 @@ if CONFIG['VPX_X86_ASM']:
     SOURCES += files['VP8_POSTPROC']
 
 arm_asm_files = []
 if CONFIG['VPX_ARM_ASM']:
     arm_asm_files += files['ARM_ASM']
 
     if CONFIG['VPX_AS_CONVERSION']:
         SOURCES += sorted([
-            "!%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
+            "!%s.s" % f
             if f.endswith('.asm') else f
             for f in sorted(arm_asm_files)
         ])
     else:
         SOURCES += sorted(arm_asm_files)
 
     for f in SOURCES:
         if f.endswith('.c') and 'neon' in f:
--- a/old-configure.in
+++ b/old-configure.in
@@ -933,17 +933,16 @@ AR_EXTRACT='$(AR) x'
 AR_DELETE='$(AR) d'
 AS='$(CC)'
 AS_DASH_C_FLAG='-c'
 DLL_PREFIX=lib
 LIB_PREFIX=lib
 DLL_SUFFIX=.so
 OBJ_SUFFIX=o
 LIB_SUFFIX=a
-ASM_SUFFIX=s
 IMPORT_LIB_SUFFIX=
 DIRENT_INO=d_ino
 MOZ_USER_DIR=".mozilla"
 
 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
 
 MOZ_FS_LAYOUT=unix
 
@@ -2059,17 +2058,16 @@ ia64*-hpux*)
         AR_EXTRACT=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
         PKG_SKIP_STRIP=1
         XARGS=xargs
         ZIP=zip
         UNZIP=unzip
         DOXYGEN=:
-        ASM_SUFFIX=asm
         OBJ_SUFFIX=obj
         LIB_SUFFIX=lib
         DLL_PREFIX=
         LIB_PREFIX=
         IMPORT_LIB_SUFFIX=lib
         MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
         MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
         dnl Set subsystem version 5 for Windows XP.
@@ -3640,17 +3638,16 @@ MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
 MOZ_VPX_ERROR_CONCEALMENT=
 MOZ_WEBSPEECH=1
 MOZ_WEBSPEECH_MODELS=
 MOZ_WEBSPEECH_POCKETSPHINX=
 MOZ_WEBSPEECH_TEST_BACKEND=1
 VPX_AS=
 VPX_ASFLAGS=
 VPX_AS_CONVERSION=
-VPX_ASM_SUFFIX=
 VPX_X86_ASM=
 VPX_ARM_ASM=
 LIBJPEG_TURBO_AS=
 LIBJPEG_TURBO_ASFLAGS=
 MOZ_PERMISSIONS=1
 MOZ_PLACES=1
 MOZ_SOCIAL=1
 MOZ_PREF_EXTENSIONS=1
@@ -5359,17 +5356,16 @@ else
 fi
 
 if test -z "$MOZ_NATIVE_LIBVPX"; then
 
     dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
     dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
     dnl We currently require gcc on all arm platforms.
     VPX_AS=$YASM
-    VPX_ASM_SUFFIX=asm
     VPX_NEED_OBJ_INT_EXTRACT=
 
     dnl See if we have assembly on this platform.
     case "$OS_ARCH:$CPU_ARCH" in
     Darwin:x86)
       VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
       VPX_X86_ASM=1
     ;;
@@ -5395,17 +5391,16 @@ if test -z "$MOZ_NATIVE_LIBVPX"; then
     ;;
     *:arm*)
       if test -n "$GNU_AS" ; then
         VPX_AS=$AS
         dnl These flags are a lie; they're just used to enable the requisite
         dnl opcodes; actual arch detection is done at runtime.
         VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
         VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
-        VPX_ASM_SUFFIX="$ASM_SUFFIX"
         VPX_ARM_ASM=1
         dnl Building with -mfpu=neon requires either the "softfp" or the
         dnl "hardfp" ABI. Depending on the compiler's default target, and the
         dnl CFLAGS, the default ABI might be neither, in which case it is the
         dnl "softfloat" ABI.
         dnl The "softfloat" ABI is binary-compatible with the "softfp" ABI, so
         dnl we can safely mix code built with both ABIs. So, if we detect
         dnl that compiling uses the "softfloat" ABI, force the use of the
@@ -8799,17 +8794,16 @@ AC_SUBST(DSO_PIC_CFLAGS)
 AC_SUBST(DSO_LDOPTS)
 AC_SUBST(LIB_PREFIX)
 AC_SUBST(DLL_PREFIX)
 AC_SUBST(DLL_SUFFIX)
 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
 AC_SUBST(LIB_SUFFIX)
 AC_SUBST(OBJ_SUFFIX)
 AC_SUBST(BIN_SUFFIX)
-AC_SUBST(ASM_SUFFIX)
 AC_SUBST(IMPORT_LIB_SUFFIX)
 AC_SUBST(USE_N32)
 AC_SUBST(CC_VERSION)
 AC_SUBST(CXX_VERSION)
 AC_SUBST(MSMANIFEST_TOOL)
 AC_SUBST(NS_ENABLE_TSF)
 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
@@ -8827,17 +8821,16 @@ AC_SUBST(MOZ_DIRECTSHOW)
 AC_SUBST(MOZ_ANDROID_OMX)
 AC_SUBST(MOZ_APPLEMEDIA)
 AC_SUBST(MOZ_OMX_PLUGIN)
 AC_SUBST(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
 AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
 AC_SUBST(VPX_AS)
 AC_SUBST_LIST(VPX_ASFLAGS)
 AC_SUBST(VPX_AS_CONVERSION)
-AC_SUBST(VPX_ASM_SUFFIX)
 AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
 AC_SUBST(MOZ_CODE_COVERAGE)
 AC_SUBST(LIBJPEG_TURBO_AS)
 AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
 AC_SUBST(MOZ_LIBAV_FFT)