Skip to content

Commit c35a1d4

Browse files
committed
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.
1 parent 9f8f0a6 commit c35a1d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: compiler/rustc_codegen_llvm/src/back/archive.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
151151
output_path.with_extension("lib")
152152
};
153153

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

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

0 commit comments

Comments
 (0)