Skip to content

Commit

Permalink
Rollup merge of #94365 - mati865:fix-mingw-detection-for-rawdylib, r=…
Browse files Browse the repository at this point in the history
…michaelwoerister

Fix MinGW target detection in raw-dylib

LLVM target doesn't have to be the same as Rust target so relying on it is wrong.

It was one of concerns in #88801 that was not fixed in #90782.
  • Loading branch information
matthiaskrgr authored Feb 28, 2022
2 parents 01ffa5f + c35a1d4 commit ea39f46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
output_path.with_extension("lib")
};

let mingw_gnu_toolchain = self.config.sess.target.llvm_target.ends_with("pc-windows-gnu");
let target = &self.config.sess.target;
let mingw_gnu_toolchain =
target.vendor == "pc" && target.os == "windows" && target.env == "gnu";

let import_name_and_ordinal_vector: Vec<(String, Option<u16>)> = dll_imports
.iter()
Expand Down

0 comments on commit ea39f46

Please sign in to comment.