Bug 1414287 - Use a 64-bits clang-cl for 32-bits static analysis builds r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 05 Oct 2018 22:56:34 +0000
changeset 495638 76fafdaa92166c344670d929a3c7d83437d4601d
parent 495633 6f233fd06aace5fdbad3ffa1692329c508b16b2b
child 495639 273e8441443436eecbdab7334e0077d24fa9dd80
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)
reviewersdmajor
bugs1414287
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 1414287 - Use a 64-bits clang-cl for 32-bits static analysis builds r=dmajor This also requires the 64-bits rust compiler and some build system tweaks. Differential Revision: https://phabricator.services.mozilla.com/D7845
browser/config/mozconfigs/win32/clang
browser/config/mozconfigs/win32/clang-debug
build/win32/mozconfig.vs2017
config/config.mk
taskcluster/ci/static-analysis/kind.yml
--- a/browser/config/mozconfigs/win32/clang
+++ b/browser/config/mozconfigs/win32/clang
@@ -5,14 +5,16 @@ MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-optimize
 
 ac_add_options --enable-clang-plugin
 
 . $topsrcdir/build/win32/mozconfig.vs-latest
-# Regardless of what mozconfig.vs-latest sets, clang-plugin builds need to use
-# the Microsoft linker until at least bugs 1414287 and 1427808 are resolved.
+
+# Regardless of what mozconfig.vs-latest sets, lld-link that comes with the old
+# clang version used for static analysis fails to link multiple things. So
+# until bug 1427808 is resolved, use the Microsoft linker.
 export LINKER=link
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.clang-cl"
--- a/browser/config/mozconfigs/win32/clang-debug
+++ b/browser/config/mozconfigs/win32/clang-debug
@@ -6,14 +6,16 @@ MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-optimize
 ac_add_options --enable-debug
 
 ac_add_options --enable-clang-plugin
 
 . $topsrcdir/build/win32/mozconfig.vs-latest
-# Regardless of what mozconfig.vs-latest sets, clang-plugin builds need to use
-# the Microsoft linker until at least bugs 1414287 and 1427808 are resolved.
+
+# Regardless of what mozconfig.vs-latest sets, lld-link that comes with the old
+# clang version used for static analysis fails to link multiple things. So
+# until bug 1427808 is resolved, use the Microsoft linker.
 export LINKER=link
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.clang-cl"
--- a/build/win32/mozconfig.vs2017
+++ b/build/win32/mozconfig.vs2017
@@ -16,16 +16,19 @@ if [ -d "${VSPATH}" ]; then
 
     export INCLUDE="${VSPATH}/VC/include:${VSPATH}/VC/atlmfc/include:${VSPATH}/SDK/Include/10.0.17134.0/ucrt:${VSPATH}/SDK/Include/10.0.17134.0/shared:${VSPATH}/SDK/Include/10.0.17134.0/um:${VSPATH}/SDK/Include/10.0.17134.0/winrt:${VSPATH}/DIA SDK/include"
     export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/VC/atlmfc/lib/x86:${VSPATH}/SDK/Lib/10.0.17134.0/ucrt/x86:${VSPATH}/SDK/Lib/10.0.17134.0/um/x86:${VSPATH}/DIA SDK/lib"
 
     export WIN64_LINK="${VSPATH}/VC/bin/Hostx64/x64/link.exe"
     export WIN64_LIB="${VSPATH}/VC/lib/x64:${VSPATH}/VC/atlmfc/lib/x64:${VSPATH}/SDK/Lib/10.0.17134.0/ucrt/x64:${VSPATH}/SDK/Lib/10.0.17134.0/um/x64:${VSPATH}/DIA SDK/lib/amd64"
 fi
 
+ac_add_options --target=i686-pc-mingw32
+ac_add_options --host=x86_64-pc-mingw32
+
 . $topsrcdir/build/mozconfig.vs-common
 
 mk_export_correct_style WINDOWSSDKDIR
 mk_export_correct_style WIN32_REDIST_DIR
 mk_export_correct_style WIN_UCRT_REDIST_DIR
 mk_export_correct_style WIN_DIA_SDK_BIN_DIR
 mk_export_correct_style PATH
 mk_export_correct_style INCLUDE
--- a/config/config.mk
+++ b/config/config.mk
@@ -196,16 +196,23 @@ COMPILE_CMFLAGS = $(MOZ_LTO_CFLAGS) $(OS
 COMPILE_CMMFLAGS = $(MOZ_LTO_CFLAGS) $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS)
 ASFLAGS = $(COMPUTED_ASFLAGS)
 SFLAGS = $(COMPUTED_SFLAGS)
 
 HOST_CFLAGS = $(COMPUTED_HOST_CFLAGS) $(_DEPEND_CFLAGS)
 HOST_CXXFLAGS = $(COMPUTED_HOST_CXXFLAGS) $(_DEPEND_CFLAGS)
 HOST_C_LDFLAGS = $(COMPUTED_HOST_C_LDFLAGS)
 HOST_CXX_LDFLAGS = $(COMPUTED_HOST_CXX_LDFLAGS)
+# Win32 Cross-builds on win64 need to override LIB when invoking the linker,
+# which we do for rust through cargo-linker.bat, so we abuse it here.
+# Ideally, we'd empty LIB and pass -LIBPATH options to the linker somehow but
+# we don't have this in place for rust, so...
+ifdef WIN64_CARGO_LINKER
+HOST_LINKER = $(topobjdir)/build/win64/cargo-linker.bat
+endif
 
 ifdef MOZ_LTO
 ifeq (Darwin,$(OS_TARGET))
 # When linking on macOS, debug info is not linked along with the final binary,
 # and the dwarf data stays in object files until they are "linked" with the
 # dsymutil tool.
 # With LTO, object files are temporary, and are not kept around, which
 # means there's no object file for dsymutil to do its job. Consequently,
--- a/taskcluster/ci/static-analysis/kind.yml
+++ b/taskcluster/ci/static-analysis/kind.yml
@@ -43,18 +43,18 @@ jobs:
             options: [append-env-variables-from-configs]
             script: mozharness/scripts/fx_desktop_build.py
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
                 - builds/taskcluster_sub_win32/clang_debug.py
         toolchains:
-            - win32-clang-cl-st-an
-            - win32-rust
+            - win64-clang-cl-st-an
+            - win64-rust
             - win64-cbindgen
             - win64-sccache
             - win64-node
 
     win32-st-an/opt:
         description: "Win32 Static Analysis Opt (clang-cl)"
         index:
             product: firefox
@@ -74,18 +74,18 @@ jobs:
             options: [append-env-variables-from-configs]
             script: mozharness/scripts/fx_desktop_build.py
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
                 - builds/taskcluster_sub_win32/clang.py
         toolchains:
-            - win32-clang-cl-st-an
-            - win32-rust
+            - win64-clang-cl-st-an
+            - win64-rust
             - win64-cbindgen
             - win64-sccache
             - win64-node
 
     win64-st-an/debug:
         description: "Win64 Static Analysis Debug (clang-cl)"
         index:
             product: firefox