Skip to content

Commit

Permalink
fix: preserve msvc linker fallback logic
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed Aug 19, 2018
1 parent 98e4cd5 commit a6f4ae8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_codegen_llvm/back/link.rs
Expand Up @@ -75,7 +75,9 @@ pub fn get_linker(sess: &Session, linker: &Path, flavor: LinkerFlavor) -> (PathB
Some(linker) if cfg!(windows) && linker.ends_with(".bat") => Command::bat_script(linker),
_ => match flavor {
LinkerFlavor::Lld(f) => Command::lld(linker, f),
LinkerFlavor::Msvc => {
LinkerFlavor::Msvc
if sess.opts.cg.linker.is_none() && sess.target.target.options.linker.is_none() =>
{
Command::new(msvc_tool.as_ref().map(|t| t.path()).unwrap_or(linker))
},
_ => Command::new(linker),
Expand Down

0 comments on commit a6f4ae8

Please sign in to comment.