Bug 1562389 - Set correct triple for rustc when host and target are different compiler type. r=froydnj

When host and target are different compiler type, triple for rustc may be incorrect. If target is clang, host is always clang, not using host compiler type.

Example, when host is clang-cl for windows, and target is clang for Android, host's triple for ructc sets `windows-gnu`, not `windows-msvc`.

Differential Revision: https://phabricator.services.mozilla.com/D36421

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Makoto Kato 2019-07-01 20:11:08 +00:00
Родитель e4c1e944b8
Коммит 52aaf37d4d
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -219,7 +219,7 @@ def rust_supported_targets(rustc):
@template
def rust_triple_alias(host_or_target):
def rust_triple_alias(host_or_target, host_or_target_c_compiler):
"""Template defining the alias used for rustc's --target flag.
`host_or_target` is either `host` or `target` (the @depends functions
from init.configure).
@ -228,8 +228,8 @@ def rust_triple_alias(host_or_target):
host_or_target_str = {host: 'host', target: 'target'}[host_or_target]
@depends(rustc, host_or_target, c_compiler, rust_supported_targets,
arm_target, when=rust_compiler)
@depends(rustc, host_or_target, host_or_target_c_compiler,
rust_supported_targets, arm_target, when=rust_compiler)
@checking('for rust %s triplet' % host_or_target_str)
@imports('os')
@imports('subprocess')
@ -324,8 +324,8 @@ def rust_triple_alias(host_or_target):
return rust_target
rust_target_triple = rust_triple_alias(target)
rust_host_triple = rust_triple_alias(host)
rust_target_triple = rust_triple_alias(target, c_compiler)
rust_host_triple = rust_triple_alias(host, host_c_compiler)
@depends(host, rust_host_triple, rustc_info.host)