Skip to content

Commit a6f4ae8

Browse files
committed
fix: preserve msvc linker fallback logic
1 parent 98e4cd5 commit a6f4ae8

File tree

1 file changed

+3
-1
lines changed
  • src/librustc_codegen_llvm/back

1 file changed

+3
-1
lines changed

Diff for: src/librustc_codegen_llvm/back/link.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ pub fn get_linker(sess: &Session, linker: &Path, flavor: LinkerFlavor) -> (PathB
7575
Some(linker) if cfg!(windows) && linker.ends_with(".bat") => Command::bat_script(linker),
7676
_ => match flavor {
7777
LinkerFlavor::Lld(f) => Command::lld(linker, f),
78-
LinkerFlavor::Msvc => {
78+
LinkerFlavor::Msvc
79+
if sess.opts.cg.linker.is_none() && sess.target.target.options.linker.is_none() =>
80+
{
7981
Command::new(msvc_tool.as_ref().map(|t| t.path()).unwrap_or(linker))
8082
},
8183
_ => Command::new(linker),

0 commit comments

Comments
 (0)