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

@ -47,6 +47,7 @@ pub(crate) fn get_linker<'a>(
self_contained: bool,
target_cpu: &'a str,
) -> Box<dyn Linker + 'a> {
// FIXME(cc-rs#1265) pass only target arch to find_tool()
let msvc_tool = windows_registry::find_tool(sess.opts.target_triple.tuple(), "link.exe");
// If our linker looks like a batch script on Windows then to execute this