about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back/linker.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-26 03:21:26 +0000
committerbors <bors@rust-lang.org>2025-03-26 03:21:26 +0000
commit6e8abb5ec65ac50f934df6cf0e8f248dc8e8805e (patch)
tree6ba75cd5ab736d005c0bc638d8585c445d6f0ac5 /compiler/rustc_codegen_ssa/src/back/linker.rs
parent068609ce766e55d2e7371cd2a86143a6d7e8e2e4 (diff)
parentdeb987b69dae0857a9e108f86bf24c60150a6e9f (diff)
downloadrust-6e8abb5ec65ac50f934df6cf0e8f248dc8e8805e.tar.gz
rust-6e8abb5ec65ac50f934df6cf0e8f248dc8e8805e.zip
Auto merge of #138956 - jhpratt:rollup-6g7ppwd, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - #138128 (Stabilize `#![feature(precise_capturing_in_traits)]`)
 - #138834 (Group test diffs by stage in post-merge analysis)
 - #138867 (linker: Fix staticlib naming for UEFI)
 - #138874 (Batch mark waiters as unblocked when resuming in the deadlock handler)
 - #138875 (Trusty: Fix build for anonymous pipes and std::sys::process)
 - #138877 (Ignore doctests only in specified targets)
 - #138885 (Fix ui pattern_types test for big-endian platforms)
 - #138905 (Add target maintainer information for powerpc64-unknown-linux-musl)
 - #138911 (Allow defining opaques in statics and consts)
 - #138917 (rustdoc: remove useless `Symbol::is_empty` checks.)
 - #138945 (Override PartialOrd methods for bool)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/linker.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index 3f5e0c1bce9..bcf18cf57be 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -450,9 +450,10 @@ impl<'a> GccLinker<'a> {
                     // The output filename already contains `dll_suffix` so
                     // the resulting import library will have a name in the
                     // form of libfoo.dll.a
-                    let mut implib_name = OsString::from(&*self.sess.target.staticlib_prefix);
+                    let (prefix, suffix) = self.sess.staticlib_components(false);
+                    let mut implib_name = OsString::from(prefix);
                     implib_name.push(name);
-                    implib_name.push(&*self.sess.target.staticlib_suffix);
+                    implib_name.push(suffix);
                     let mut out_implib = OsString::from("--out-implib=");
                     out_implib.push(out_filename.with_file_name(implib_name));
                     self.link_arg(out_implib);
@@ -958,9 +959,9 @@ impl<'a> Linker for MsvcLinker<'a> {
         if let Some(path) = try_find_native_static_library(self.sess, name, verbatim) {
             self.link_staticlib_by_path(&path, whole_archive);
         } else {
-            let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" };
-            let suffix = if verbatim { "" } else { ".lib" };
-            self.link_arg(format!("{prefix}{name}{suffix}"));
+            let opts = if whole_archive { "/WHOLEARCHIVE:" } else { "" };
+            let (prefix, suffix) = self.sess.staticlib_components(verbatim);
+            self.link_arg(format!("{opts}{prefix}{name}{suffix}"));
         }
     }