Skip to content

Commit 68c22a1

Browse files
chouquetteehuss
authored andcommitted
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 97d39ae commit 68c22a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ impl TargetInfo {
258258
should_replace_hyphens: false,
259259
})
260260
}
261+
else if target_triple.ends_with("windows-gnu")
262+
&& crate_type.ends_with("dylib")
263+
&& suffix == ".dll"
264+
{
265+
ret.push(FileType {
266+
suffix: ".dll.a".to_string(),
267+
prefix: "lib".to_string(),
268+
flavor: FileFlavor::Normal,
269+
should_replace_hyphens: false,
270+
})
271+
}
261272

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

0 commit comments

Comments
 (0)