Bug 1162845 - Move ASFLAGS to moz.build. r=mshal

This commit is contained in:
Mike Hommey 2015-05-08 14:13:10 +09:00
parent 0b54d446ad
commit bf048111fa
15 changed files with 65 additions and 70 deletions

View File

@ -186,7 +186,14 @@ ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif
ifeq ($(YASM),$(AS))
# yasm doesn't like the GNU as flags we may already have in ASFLAGS, so reset.
ASFLAGS := $(_DEBUG_ASFLAGS)
# yasm doesn't like -c
AS_DASH_C_FLAG=
else
ASFLAGS += $(_DEBUG_ASFLAGS)
endif
OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
OS_LDFLAGS += $(_DEBUG_LDFLAGS)
@ -428,7 +435,7 @@ COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO
COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_CPPFLAGS) $(OS_COMPILE_CXXFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) $(EXTRA_COMPILE_FLAGS)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS) $(EXTRA_COMPILE_FLAGS)
COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS) $(EXTRA_COMPILE_FLAGS)
ASFLAGS += $(EXTRA_ASSEMBLER_FLAGS)
ASFLAGS += $(MOZBUILD_ASFLAGS) $(EXTRA_ASSEMBLER_FLAGS)
ifndef CROSS_COMPILE
HOST_CFLAGS += $(RTL_FLAGS)

View File

@ -3866,7 +3866,6 @@ MOZ_VPX_ERROR_CONCEALMENT=
MOZ_WEBSPEECH=1
VPX_AS=
VPX_ASFLAGS=
VPX_AS_DASH_C_FLAG=
VPX_AS_CONVERSION=
VPX_ASM_SUFFIX=
VPX_X86_ASM=
@ -5484,7 +5483,6 @@ if test -n "$MOZ_VPX" -a -z "$MOZ_NATIVE_LIBVPX"; then
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_DASH_C_FLAG="-c"
VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
VPX_ASM_SUFFIX="$ASM_SUFFIX"
VPX_ARM_ASM=1
@ -8864,8 +8862,7 @@ AC_SUBST(MOZ_OMX_PLUGIN)
AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
AC_SUBST(MOZ_VPX)
AC_SUBST(VPX_AS)
AC_SUBST(VPX_ASFLAGS)
AC_SUBST(VPX_DASH_C_FLAG)
AC_SUBST_LIST(VPX_ASFLAGS)
AC_SUBST(VPX_AS_CONVERSION)
AC_SUBST(VPX_ASM_SUFFIX)
AC_SUBST(VPX_X86_ASM)
@ -8874,7 +8871,7 @@ 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(LIBJPEG_TURBO_ASFLAGS)
AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
AC_SUBST(LIBJPEG_TURBO_X86_ASM)
AC_SUBST(LIBJPEG_TURBO_X64_ASM)
AC_SUBST(LIBJPEG_TURBO_ARM_ASM)

View File

@ -5,12 +5,6 @@
AS=$(LIBJPEG_TURBO_AS)
ASM_SUFFIX=asm
ASFLAGS=$(LIBJPEG_TURBO_ASFLAGS) -I$(topsrcdir)/media/libjpeg/simd/
ifeq ($(AS),yasm)
# yasm doesn't like -c
AS_DASH_C_FLAG=
endif
include $(topsrcdir)/config/rules.mk

View File

@ -150,6 +150,9 @@ else: # No SIMD support?
'jsimd_none.c',
]
ASFLAGS += CONFIG['LIBJPEG_TURBO_ASFLAGS']
ASFLAGS += ['-I%s/media/libjpeg/simd/' % TOPSRCDIR]
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True

View File

@ -7,10 +7,6 @@ include $(topsrcdir)/config/rules.mk
ifdef GNU_AS
ifeq ($(CPU_ARCH),arm)
# These flags are a lie; they're just used to enable the requisite
# opcodes; actual arch detection is done at runtime.
ASFLAGS = -march=armv7-a -mfpu=neon
celt_pitch_xcorr_arm-gnu.$(ASM_SUFFIX): celt/arm/armopts-gnu.S
# armopts needs a specific rule, because arm2gnu.pl will always add the .S

View File

@ -100,6 +100,12 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
CXXFLAGS += [
'-O3',
]
# These flags are a lie; they're just used to enable the requisite
# opcodes; actual arch detection is done at runtime.
ASFLAGS += [
'-march=armv7-a',
'-mfpu=neon',
]
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:

View File

@ -6,10 +6,6 @@
ifdef GNU_AS
ifeq ($(CPU_ARCH),arm)
# These flags are a lie; they're just used to enable the requisite
# opcodes; actual arch detection is done at runtime.
ASFLAGS = -march=armv7-a -mfpu=neon
armfrag-gnu.$(ASM_SUFFIX): armopts-gnu.S
armidct-gnu.$(ASM_SUFFIX): armopts-gnu.S
armloop-gnu.$(ASM_SUFFIX): armopts-gnu.S

View File

@ -45,14 +45,6 @@ UNIFIED_SOURCES += [
LOCAL_INCLUDES += ['include']
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
'armbits-gnu',
'armfrag-gnu',
'armidct-gnu',
'armloop-gnu',
]]
if '86' in CONFIG['OS_TEST']:
if CONFIG['OS_ARCH'] != 'SunOS':
if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
@ -94,3 +86,16 @@ if CONFIG['GNU_AS']:
if CONFIG['OS_TARGET'] == 'Android':
DEFINES['__linux__'] = True
GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) 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.
ASFLAGS += [
'-march=armv7-a',
'-mfpu=neon',
]

View File

@ -5,15 +5,8 @@
# Set up the libvpx assembler config.
AS=$(VPX_AS)
ASFLAGS=$(VPX_ASFLAGS) -I. -I$(topsrcdir)/media/libvpx/ -I$(topsrcdir)/media/libvpx/vpx_ports/
AS_DASH_C_FLAG=$(VPX_DASH_C_FLAG)
ASM_SUFFIX=$(VPX_ASM_SUFFIX)
ifeq ($(OS_TARGET),Android)
# For LIBVPX_RAND
ASFLAGS += -D__ANDROID__
endif
ifdef VPX_ARM_ASM
# Building on an ARM platform with a supported assembler, include
# the optimized assembly in the build.

View File

@ -105,3 +105,16 @@ if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += ['-Wno-sign-compare']
ASFLAGS += CONFIG['VPX_ASFLAGS']
ASFLAGS += [
'-I.',
'-I%s/media/libvpx/' % TOPSRCDIR,
'-I%s/media/libvpx/vpx_ports/' % TOPSRCDIR,
]
if CONFIG['OS_TARGET'] == 'Android':
# For LIBVPX_RAND
ASFLAGS += [
'-D__ANDROID__'
]

View File

@ -73,6 +73,7 @@ from ..makeutil import Makefile
MOZBUILD_VARIABLES = [
'ANDROID_GENERATED_RESFILES',
'ANDROID_RES_DIRS',
'ASFLAGS',
'CMSRCS',
'CMMSRCS',
'CPP_UNIT_TESTS',

View File

@ -1362,6 +1362,15 @@ VARIABLES = {
appear in the moz.build file.
""", None),
'ASFLAGS': (List, list,
"""Flags passed to the assembler for all of the assembly source files
declared in this directory.
Note that the ordering of flags matters here; these flags will be
added to the assembler's command line in the same order as they
appear in the moz.build file.
""", None),
'LDFLAGS': (List, list,
"""Flags passed to the linker when linking all of the libraries and
executables declared in this directory.

View File

@ -582,7 +582,8 @@ class TreeMetadataEmitter(LoggingMixin):
for dll in context['DELAYLOAD_DLLS']])
context['OS_LIBS'].append('delayimp')
for v in ['CFLAGS', 'CXXFLAGS', 'CMFLAGS', 'CMMFLAGS', 'LDFLAGS']:
for v in ['CFLAGS', 'CXXFLAGS', 'CMFLAGS', 'CMMFLAGS', 'ASFLAGS',
'LDFLAGS']:
if v in context and context[v]:
passthru.variables['MOZBUILD_' + v] = context[v]

View File

@ -31,16 +31,6 @@ endif
endif
######################################################################
# M68k
######################################################################
ifeq ($(OS_ARCH),Linux)
ifneq (,$(findstring mips, $(OS_TEST)))
ASFLAGS += -I$(DIST)/include
endif
endif
######################################################################
# PowerPC
######################################################################
@ -52,20 +42,6 @@ ifeq ($(OS_ARCH),AIX)
CXXFLAGS := $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
endif
######################################################################
# SPARC
######################################################################
#
# Solaris/SPARC
#
ifeq ($(OS_ARCH),SunOS)
ifneq (86,$(findstring 86,$(OS_TEST)))
ifdef HAVE_64BIT_BUILD
ASFLAGS += -xarch=v9
endif
endif
endif
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),Linux)
@ -98,10 +74,6 @@ xptcstubsdef_asm.solx86: $(DIST)/include/xptcstubsdef.inc
-e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
-e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
$(DIST)/include/xptcstubsdef.inc > $@
ifeq (x86_64,$(OS_TEST))
ASFLAGS += -xarch=amd64
endif
endif
endif
endif

View File

@ -59,6 +59,7 @@ if CONFIG['OS_ARCH'] == 'SunOS' and '86' in CONFIG['OS_TEST']:
'xptcstubs_x86_64_linux.cpp'
]
else:
ASFLAGS += ['-xarch=amd64']
SOURCES += [
'xptcinvoke_x86_64_solaris.cpp',
'xptcstubs_asm_x86_64_solaris_SUNW.s',
@ -271,6 +272,7 @@ if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64
if CONFIG['OS_ARCH'] == 'SunOS' and '86' not in CONFIG['OS_TEST']:
if CONFIG['HAVE_64BIT_BUILD']:
ASFLAGS += ['-xarch=v9']
SOURCES += [
'xptcinvoke_sparcv9_solaris.cpp',
'xptcstubs_sparcv9_solaris.cpp',