Skip to content

Commit 445eda8

Browse files
authored
Rollup merge of rust-lang#133955 - bjorn3:cc_pass_arch_only, r=ChrisDenton
Pass the arch rather than full target name to windows_registry::find_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 thanks to rust-lang/cc-rs#1285. try-job: i686-mingw
2 parents 0a9bcd8 + 5e66869 commit 445eda8

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,8 @@ fn link_natively(
10151015
&& (code < 1000 || code > 9999)
10161016
{
10171017
let is_vs_installed = windows_registry::find_vs_version().is_ok();
1018-
// FIXME(cc-rs#1265) pass only target arch to find_tool()
1019-
let has_linker = windows_registry::find_tool(
1020-
sess.opts.target_triple.tuple(),
1021-
"link.exe",
1022-
)
1023-
.is_some();
1018+
let has_linker =
1019+
windows_registry::find_tool(&sess.target.arch, "link.exe").is_some();
10241020

10251021
sess.dcx().emit_note(errors::LinkExeUnexpectedError);
10261022
if is_vs_installed && has_linker {

compiler/rustc_codegen_ssa/src/back/linker.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ pub(crate) fn get_linker<'a>(
5050
self_contained: bool,
5151
target_cpu: &'a str,
5252
) -> Box<dyn Linker + 'a> {
53-
// FIXME(cc-rs#1265) pass only target arch to find_tool()
54-
let msvc_tool = windows_registry::find_tool(sess.opts.target_triple.tuple(), "link.exe");
53+
let msvc_tool = windows_registry::find_tool(&sess.target.arch, "link.exe");
5554

5655
// If our linker looks like a batch script on Windows then to execute this
5756
// we'll need to spawn `cmd` explicitly. This is primarily done to handle

0 commit comments

Comments
 (0)