From e65481e7fb665fde90d4100f4e3f30c27a3c3251 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 8 Jul 2020 13:53:27 +0000 Subject: [PATCH] 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 --- build/moz.configure/toolchain.configure | 13 ------------- python/mozbuild/mozbuild/frontend/emitter.py | 7 ++----- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 73d1789d5b0a..ac44f413a120 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -1784,19 +1784,6 @@ set_config('HAVE_YASM', have_yasm) 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 # ============================================================== diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index ea966bc876d8..4f9a616dab4b 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -1411,14 +1411,11 @@ class TreeMetadataEmitter(LoggingMixin): 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