From e57877cd63257527fd14442dd06816fc385cb2b9 Mon Sep 17 00:00:00 2001 From: David Major Date: Tue, 21 Aug 2018 11:30:16 -0400 Subject: [PATCH] Bug 1483835: Default to clang-cl and lld-link in local Windows builds. r=glandium --- build/moz.configure/toolchain.configure | 2 +- build/moz.configure/windows.configure | 3 ++- .../test/configure/test_toolchain_configure.py | 14 +++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 22e58a46a41a..abe244b8143b 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -689,7 +689,7 @@ def default_c_compilers(host_or_target): return (android_clang_compiler,) + gcc if host_or_target.kernel == 'WINNT': - return ('cl', 'clang-cl') + gcc + ('clang',) + return ('clang-cl', 'cl') + gcc + ('clang',) if host_or_target.kernel == 'Darwin': return ('clang',) if developer_options: diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure index 25c2e6f3df7f..1e498ddbf2c1 100644 --- a/build/moz.configure/windows.configure +++ b/build/moz.configure/windows.configure @@ -459,7 +459,8 @@ def valid_mt(path): set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x))) -link = check_prog('LINKER', ('link.exe',), paths=toolchain_search_path) +link = check_prog('LINKER', ('lld-link.exe', 'link.exe'), + paths=toolchain_search_path) add_old_configure_assignment('LINKER', link) diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py index 8733e8a54c2b..f738024add45 100755 --- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py @@ -967,7 +967,12 @@ class WindowsToolchainTest(BaseToolchainTest): # VS2017u6 or greater is required. def test_msvc(self): - self.do_toolchain_test(self.PATHS, { + # We'll pick msvc if clang-cl can't be found. + paths = { + k: v for k, v in self.PATHS.iteritems() + if os.path.basename(k) != 'clang-cl' + } + self.do_toolchain_test(paths, { 'c_compiler': self.VS_2017u6_RESULT, 'cxx_compiler': self.VSXX_2017u6_RESULT, }) @@ -1016,12 +1021,7 @@ class WindowsToolchainTest(BaseToolchainTest): }) def test_clang_cl(self): - # We'll pick clang-cl if msvc can't be found. - paths = { - k: v for k, v in self.PATHS.iteritems() - if os.path.basename(k) != 'cl' - } - self.do_toolchain_test(paths, { + self.do_toolchain_test(self.PATHS, { 'c_compiler': self.CLANG_CL_3_9_RESULT, 'cxx_compiler': self.CLANGXX_CL_3_9_RESULT, })