Bug 1481504 - fix HOST_OUTOPTION setting for Windows cross-compiles; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Mon, 20 Aug 2018 17:22:44 -0400
changeset 487591 0b502a7a768ff6b44e2c26e3e4787d80f3ea8099
parent 487590 8229a612b15e5f233a33e8756c9dba9c07c57a83
child 487592 dfd04e76e5a6617227c9da8c6961564446cf0f9d
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1481504
milestone63.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 1481504 - fix HOST_OUTOPTION setting for Windows cross-compiles; r=mshal For "real" Windows-to-Windows cross compiles, the setting of HOST_OUTOPTION is incorrect: it assumes that if we are cross-compiling, we'll be using `-o ` (GNU-style) rather than `-Fo` (MSVC-style). Our normal x86 Windows automation builds are technically not cross-compiles (host and target are both x86 Windows), so this case has never bothered us before. But when compiling for AArch64 Windows, we are really doing a cross-compile, and so we need to be more careful about how we set this option; otherwise, host compilations will mysteriously fail because they won't produce any output.
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -383,18 +383,27 @@ 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!)
+endif
+HOST_OUTOPTION = -Fo# eol
+else
 HOST_OUTOPTION = -o # eol
 endif
+endif
 ################################################################################
 
 # Ensure the build config is up to date. This is done automatically when builds
 # are performed through |mach build|. The check here is to catch people not
 # using mach. If we ever enforce builds through mach, this code can be removed.
 ifndef MOZBUILD_BACKEND_CHECKED
 ifndef MACH
 ifndef TOPLEVEL_BUILD