Skip to content

Commit

Permalink
Add implib to the stamp files
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chouquette committed May 16, 2019
1 parent c4fcfb7 commit 7f1c3c7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 7f1c3c7

Please sign in to comment.