|
@@ -0,0 +1,80 @@
|
|
|
|
+# HG changeset patch
|
|
|
|
+# User Mike Hommey <mh+mozilla@glandium.org>
|
|
|
|
+# Date 1594216407 0
|
|
|
|
+# Node ID 38443050a4947c2769c656e87d49fc6bcb4d217a
|
|
|
|
+# Parent 8dc91932c0b801d1b4e3092b31c4680b939fa5a4
|
|
|
|
+Bug 1651305 - Simplify how USE_INTEGRATED_CLANGCL_AS is handled. r=froydnj
|
|
|
|
+
|
|
|
|
+The current setup sets /some/ flags via CLANGCL_ASFLAGS (handling of x86
|
|
|
|
+is notably missing, for instance), and uses "clang-cl" as the assembler,
|
|
|
|
+assuming it's in $PATH.
|
|
|
|
+
|
|
|
|
+This can be simplified by just using `CC`, which will contain the full
|
|
|
|
+path to "clang-cl" and the right flags for the targets, which makes
|
|
|
|
+CLANGCL_ASFLAGS unnecessary.
|
|
|
|
+
|
|
|
|
+Differential Revision: https://phabricator.services.mozilla.com/D82660
|
|
|
|
+
|
|
|
|
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
|
|
|
|
+--- a/build/moz.configure/toolchain.configure
|
|
|
|
++++ b/build/moz.configure/toolchain.configure
|
|
|
|
+@@ -2218,29 +2218,16 @@ def have_yasm(yasm_asflags):
|
|
|
|
+
|
|
|
|
+ set_config('HAVE_NASM', have_nasm)
|
|
|
|
+
|
|
|
|
+ set_config('HAVE_YASM', have_yasm)
|
|
|
|
+ # Until the YASM variable is not necessary in old-configure.
|
|
|
|
+ add_old_configure_assignment('YASM', have_yasm)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-# clang-cl integrated assembler support
|
|
|
|
+-# ==============================================================
|
|
|
|
+-@depends(target)
|
|
|
|
+-def clangcl_asflags(target):
|
|
|
|
+- asflags = None
|
|
|
|
+- if target.os == 'WINNT' and target.cpu == 'aarch64':
|
|
|
|
+- asflags = ['--target=aarch64-windows-msvc']
|
|
|
|
+- return asflags
|
|
|
|
+-
|
|
|
|
+-
|
|
|
|
+-set_config('CLANGCL_ASFLAGS', clangcl_asflags)
|
|
|
|
+-
|
|
|
|
+-
|
|
|
|
+ # Code Coverage
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+ js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
|
|
|
|
+ help='Enable code coverage')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-coverage')
|
|
|
|
+ def code_coverage(value):
|
|
|
|
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
|
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
|
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
|
+@@ -1328,24 +1328,21 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
|
+ raise SandboxValidationError('nasm is not available', context)
|
|
|
|
+ passthru.variables['AS'] = nasm
|
|
|
|
+ passthru.variables['AS_DASH_C_FLAG'] = ''
|
|
|
|
+ passthru.variables['ASOUTOPTION'] = '-o '
|
|
|
|
+ computed_as_flags.resolve_flags('OS',
|
|
|
|
+ context.config.substs.get('NASM_ASFLAGS', []))
|
|
|
|
+
|
|
|
|
+ if context.get('USE_INTEGRATED_CLANGCL_AS') is True:
|
|
|
|
+- clangcl = context.config.substs.get('CLANG_CL')
|
|
|
|
+- if not clangcl:
|
|
|
|
++ if context.config.substs.get('CC_TYPE') != 'clang-cl':
|
|
|
|
+ raise SandboxValidationError('clang-cl is not available', context)
|
|
|
|
+- passthru.variables['AS'] = 'clang-cl'
|
|
|
|
++ passthru.variables['AS'] = context.config.substs.get('CC')
|
|
|
|
+ passthru.variables['AS_DASH_C_FLAG'] = '-c'
|
|
|
|
+ passthru.variables['ASOUTOPTION'] = '-o '
|
|
|
|
+- computed_as_flags.resolve_flags('OS',
|
|
|
|
+- context.config.substs.get('CLANGCL_ASFLAGS', []))
|
|
|
|
+
|
|
|
|
+ if passthru.variables:
|
|
|
|
+ yield passthru
|
|
|
|
+
|
|
|
|
+ if context.objdir in self._compile_dirs:
|
|
|
|
+ self._compile_flags[context.objdir] = computed_flags
|
|
|
|
+ yield computed_link_flags
|
|
|
|
+
|