Skip to content

Commit 65173f6

Browse files
committed
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<dllname> is only supported by gcc, while llvm needs an import library to link indirectly with a dll
1 parent b6581d3 commit 65173f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/cargo/core/compiler/build_context/target_info.rs

+12
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ impl TargetInfo {
192192
should_replace_hyphens: false,
193193
})
194194
}
195+
else if (target_triple.ends_with("pc-windows-gnu") ||
196+
target_triple.ends_with("pc-uwp-gnu"))
197+
&& crate_type.ends_with("dylib")
198+
&& suffix == ".dll"
199+
{
200+
ret.push(FileType {
201+
suffix: ".dll.a".to_string(),
202+
prefix: "lib".to_string(),
203+
flavor: FileFlavor::Normal,
204+
should_replace_hyphens: false,
205+
})
206+
}
195207

196208
// See rust-lang/cargo#4535.
197209
if target_triple.starts_with("wasm32-") && crate_type == "bin" && suffix == ".js" {

0 commit comments

Comments
 (0)