From 7f1c3c7e9b88bd37e7f2b839d9a520c7b66701ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 17 Apr 2019 15:49:07 +0200 Subject: [PATCH] Add implib to the stamp files This was already done when targetting msvc, but it needs to be done for all targets to allow rustc to link with shared libraries when using llvm -l is only supported by gcc, while llvm needs an import library to link indirectly with a dll --- src/cargo/core/compiler/build_context/target_info.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index 8abc579e713..11b9894d52a 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -213,6 +213,17 @@ impl TargetInfo { should_replace_hyphens: false, }) } + else if target_triple.ends_with("windows-gnu") + && crate_type.ends_with("dylib") + && suffix == ".dll" + { + ret.push(FileType { + suffix: ".dll.a".to_string(), + prefix: "lib".to_string(), + flavor: FileFlavor::Normal, + should_replace_hyphens: false, + }) + } // See rust-lang/cargo#4535. if target_triple.starts_with("wasm32-") && crate_type == "bin" && suffix == ".js" {