Bug 1397263 - move ASOUTOPTION to moz.configure; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Wed, 03 Oct 2018 20:29:29 -0400
changeset 495303 237dbec378d81d707afbf97e1818fea97c972844
parent 495302 23f384237f7320a5f5ef99f19781feb0227faf7e
child 495304 d678adeaddcd50c3d49c6a4afe3395f1a10853e1
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1397263
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397263 - move ASOUTOPTION to moz.configure; r=mshal
build/moz.configure/toolchain.configure
config/rules.mk
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1901,16 +1901,28 @@ def as_dash_c_flag(as_info, target):
     if as_info.type == 'masm' and target.cpu == 'aarch64':
         return ''
     else:
         return '-c'
 
 
 set_config('AS_DASH_C_FLAG', as_dash_c_flag)
 
+
+@depends(as_info, target)
+def as_outoption(as_info, target):
+    # The uses of ASOUTOPTION depend on the spacing for -o/-Fo.
+    if as_info.type == 'masm' and target.cpu != 'aarch64':
+        return '-Fo'
+
+    return '-o '
+
+
+set_config('ASOUTOPTION', as_outoption)
+
 # clang plugin handling
 # ==============================================================
 
 js_option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN',
           help="Enable building with the mozilla clang plugin")
 
 add_old_configure_assignment('ENABLE_CLANG_PLUGIN',
                              depends_if('--enable-clang-plugin')(lambda _: True))
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -371,22 +371,16 @@ IFLAGS2 = -m 755
 endif
 
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 OUTOPTION = -Fo# eol
 else
 OUTOPTION = -o # eol
 endif # WINNT && !GNU_CC
 
-ifneq (,$(filter ml%,$(AS)))
-ASOUTOPTION = -Fo# eol
-else
-ASOUTOPTION = -o # eol
-endif
-
 ifeq (,$(CROSS_COMPILE))
 HOST_OUTOPTION = $(OUTOPTION)
 else
 # Windows-to-Windows cross compiles should always use MSVC-style options for
 # host compiles.
 ifeq (WINNT_WINNT,$(HOST_OS_ARCH)_$(OS_ARCH))
 ifneq (,$(filter-out msvc clang-cl,$(HOST_CC_TYPE)))
 $(error MSVC-style compilers should be used for host compilations!)
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -1335,16 +1335,17 @@ class TreeMetadataEmitter(LoggingMixin):
                                         context.get('ASFLAGS'))
 
         if context.get('USE_YASM') is True:
             yasm = context.config.substs.get('YASM')
             if not yasm:
                 raise SandboxValidationError('yasm is not available', context)
             passthru.variables['AS'] = yasm
             passthru.variables['AS_DASH_C_FLAG'] = ''
+            passthru.variables['ASOUTOPTION'] = '-o '
             computed_as_flags.resolve_flags('OS',
                                             context.config.substs.get('YASM_ASFLAGS', []))
 
 
         if passthru.variables:
             yield passthru
 
         if context.objdir in self._compile_dirs:
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -454,17 +454,18 @@ class TestEmitterBasic(unittest.TestCase
         self.assertIsInstance(asflags, ComputedFlags)
 
         self.assertEqual(asflags.flags['OS'], reader.config.substs['YASM_ASFLAGS'])
 
         maxDiff = self.maxDiff
         self.maxDiff = None
         self.assertEqual(passthru.variables,
                          {'AS': 'yasm',
-                          'AS_DASH_C_FLAG': ''})
+                          'AS_DASH_C_FLAG': '',
+                          'ASOUTOPTION': '-o '})
         self.maxDiff = maxDiff
 
     def test_generated_files(self):
         reader = self.reader('generated-files')
         objs = self.read_topsrcdir(reader)
 
         self.assertEqual(len(objs), 3)
         for o in objs: