diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-28 12:57:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-28 12:57:48 +0100 |
| commit | ea39f46caddd3a4547517f82dd1d57a145d01b26 (patch) | |
| tree | 5b3174d80ab615e8eec9cebe89db2e692d9f5926 /compiler/rustc_codegen_llvm/src/back/archive.rs | |
| parent | 01ffa5fa0ca0e25640e87bf0f7ab9b99e7c4a1f1 (diff) | |
| parent | c35a1d40286ea806fb2225e3a6db852ba8dd71e0 (diff) | |
| download | rust-ea39f46caddd3a4547517f82dd1d57a145d01b26.tar.gz rust-ea39f46caddd3a4547517f82dd1d57a145d01b26.zip | |
Rollup merge of #94365 - mati865:fix-mingw-detection-for-rawdylib, r=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 https://github.com/rust-lang/rust/pull/88801 that was not fixed in https://github.com/rust-lang/rust/pull/90782.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/archive.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/archive.rs | 4 |
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() |
