Reduce dependence on the target name

The target name can be anything with custom target specs. Matching on
fields inside the target spec is much more robust than matching on the
target name.
This commit is contained in:
bjorn3
2024-11-03 18:26:01 +00:00
parent 7028d9318f
commit 9e6d2da83d
5 changed files with 17 additions and 26 deletions

View File

@@ -85,11 +85,7 @@ pub fn link_binary(
}
if invalid_output_for_target(sess, crate_type) {
bug!(
"invalid output type `{:?}` for target os `{}`",
crate_type,
sess.opts.target_triple
);
bug!("invalid output type `{:?}` for target `{}`", crate_type, sess.opts.target_triple);
}
sess.time("link_binary_check_files_are_writeable", || {
@@ -996,6 +992,7 @@ fn link_natively(
&& (code < 1000 || code > 9999)
{
let is_vs_installed = windows_registry::find_vs_version().is_ok();
// FIXME(cc-rs#1265) pass only target arch to find_tool()
let has_linker = windows_registry::find_tool(
sess.opts.target_triple.tuple(),
"link.exe",