about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/back
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2018-08-19 23:59:20 +0200
committerJorge Aparicio <jorge@japaric.io>2018-08-19 23:59:20 +0200
commita6f4ae864eb9a99117f7475325bf9ffb2c8e8b90 (patch)
tree676c5014e9e9fd9d17adaa5641135f05f5033229 /src/librustc_codegen_llvm/back
parent98e4cd50f9908dcf2330196baa756a775343e47d (diff)
downloadrust-a6f4ae864eb9a99117f7475325bf9ffb2c8e8b90.tar.gz
rust-a6f4ae864eb9a99117f7475325bf9ffb2c8e8b90.zip
fix: preserve msvc linker fallback logic
Diffstat (limited to 'src/librustc_codegen_llvm/back')
-rw-r--r--src/librustc_codegen_llvm/back/link.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs
index afbcaf4c659..91515d1c85b 100644
--- a/src/librustc_codegen_llvm/back/link.rs
+++ b/src/librustc_codegen_llvm/back/link.rs
@@ -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),