Bug 1443471 - Use correct rust target for mingw clang. r?glandium
MozReview-Commit-ID: G40IanxGWXv
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -144,37 +144,37 @@ def rust_supported_targets(rustc):
@template
def rust_triple_alias(host_or_target):
"""Template defining the alias used for rustc's --target flag.
`host_or_target` is either `host` or `target` (the @depends functions
from init.configure).
"""
assert host_or_target in (host, target)
- @depends(rustc, host_or_target, building_with_gcc, rust_supported_targets,
+ @depends(rustc, host_or_target, c_compiler, rust_supported_targets,
when=rust_compiler)
@imports('os')
@imports('subprocess')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='tempfile', _import='mkstemp')
@imports(_from='textwrap', _import='dedent')
- def rust_target(rustc, host_or_target, building_with_gcc,
+ def rust_target(rustc, host_or_target, compiler_info,
rust_supported_targets):
# Rust's --target options are similar to, but not exactly the same
# as, the autoconf-derived targets we use. An example would be that
# Rust uses distinct target triples for targetting the GNU C++ ABI
# and the MSVC C++ ABI on Win32, whereas autoconf has a single
# triple and relies on the user to ensure that everything is
# compiled for the appropriate ABI. We need to perform appropriate
# munging to get the correct option to rustc.
# We correlate the autoconf-derived targets with the list of targets
# rustc gives us with --print target-list.
if host_or_target.kernel == 'WINNT':
- if building_with_gcc:
+ if compiler_info.type in ('gcc', 'clang'):
host_or_target_os = 'windows-gnu'
else:
host_or_target_os = 'windows-msvc'
host_or_target_raw_os = host_or_target_os
else:
host_or_target_os = host_or_target.os
host_or_target_raw_os = host_or_target.raw_os