about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2022-02-25 17:41:00 +0100
committerMateusz Mikuła <mati865@gmail.com>2022-02-25 17:46:23 +0100
commitc35a1d40286ea806fb2225e3a6db852ba8dd71e0 (patch)
treef5f92f8a8c05811e2640b352831ec600352dba07 /compiler/rustc_codegen_llvm/src
parent9f8f0a6e9484fe25517c082a5cbe1e9edb17c8a8 (diff)
downloadrust-c35a1d40286ea806fb2225e3a6db852ba8dd71e0.tar.gz
rust-c35a1d40286ea806fb2225e3a6db852ba8dd71e0.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/archive.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs
index 1a2cec2a0d9..f814cc93043 100644
--- a/compiler/rustc_codegen_llvm/src/back/archive.rs
+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs
@@ -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()