Skip to content

Commit

Permalink
Pass the arch rather than full target name to windows_registry::find_…
Browse files Browse the repository at this point in the history
…tool

The full target name can be anything with custom target specs. Passing
just the arch wasn't possible before cc 1.2, but is now.
  • Loading branch information
bjorn3 committed Dec 6, 2024
1 parent acf4842 commit 5477d85
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,12 +1021,8 @@ 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",
)
.is_some();
let has_linker =
windows_registry::find_tool(&sess.target.arch, "link.exe").is_some();

sess.dcx().emit_note(errors::LinkExeUnexpectedError);
if is_vs_installed && has_linker {
Expand Down

0 comments on commit 5477d85

Please sign in to comment.