Skip to content

Commit 7f1c3c7

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 c4fcfb7 commit 7f1c3c7

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

+11
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ impl TargetInfo {
213213
should_replace_hyphens: false,
214214
})
215215
}
216+
else if target_triple.ends_with("windows-gnu")
217+
&& crate_type.ends_with("dylib")
218+
&& suffix == ".dll"
219+
{
220+
ret.push(FileType {
221+
suffix: ".dll.a".to_string(),
222+
prefix: "lib".to_string(),
223+
flavor: FileFlavor::Normal,
224+
should_replace_hyphens: false,
225+
})
226+
}
216227

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

0 commit comments

Comments
 (0)