1
Fork 0

Rollup merge of #90782 - ricobbe:binutils-dlltool, r=michaelwoerister

Implement raw-dylib support for windows-gnu

Add support for `#[link(kind = "raw-dylib")]` on windows-gnu targets.  Work around binutils's linker's inability to read import libraries produced by LLVM by calling out to the binutils `dlltool` utility to create an import library from a temporary .DEF file; this approach is effectively a slightly refined version of `@mati865's` earlier attempt at this strategy in PR #88801.  (In particular, this attempt at this strategy adds support for `#[link_ordinal(...)]` as well.)

In support of #58713.
This commit is contained in:
Matthias Krüger 2022-01-18 22:00:42 +01:00 committed by GitHub
commit dd621a4c5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 252 additions and 113 deletions

View file

@ -274,11 +274,6 @@ impl Collector<'_> {
span,
"`#[link(...)]` with `kind = \"raw-dylib\"` only supported on Windows",
);
} else if !self.tcx.sess.target.options.is_like_msvc {
self.tcx.sess.span_warn(
span,
"`#[link(...)]` with `kind = \"raw-dylib\"` not supported on windows-gnu",
);
}
if lib_name.as_str().contains('\0') {