about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-15 07:12:07 +0000
committerbors <bors@rust-lang.org>2024-03-15 07:12:07 +0000
commit6d9549fbe6903be8550999bc3ddc0b3c0fb94c7f (patch)
treea0f3712ca35ea796c989bf489987412776113507 /compiler/rustc_codegen_ssa/src/back
parented9d70f56cfcd33af63a5a39fdf50b7e6b862da4 (diff)
parent32c734b73cf6eada0b330337e24fee2c6039cc84 (diff)
downloadrust-6d9549fbe6903be8550999bc3ddc0b3c0fb94c7f.tar.gz
rust-6d9549fbe6903be8550999bc3ddc0b3c0fb94c7f.zip
Auto merge of #3383 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs15
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs11
2 files changed, 16 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index e70cc9b6216..1406a7d9b5c 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1081,6 +1081,21 @@ fn link_natively<'a>(
         }
     }
 
+    if sess.target.is_like_aix {
+        let stripcmd = "/usr/bin/strip";
+        match strip {
+            Strip::Debuginfo => {
+                // FIXME: AIX's strip utility only offers option to strip line number information.
+                strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-l"))
+            }
+            Strip::Symbols => {
+                // Must be noted this option might remove symbol __aix_rust_metadata and thus removes .info section which contains metadata.
+                strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-r"))
+            }
+            Strip::None => {}
+        }
+    }
+
     Ok(())
 }
 
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index b4e054417f3..bb23e21b2a2 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -1640,16 +1640,7 @@ impl<'a> Linker for AixLinker<'a> {
 
     fn ehcont_guard(&mut self) {}
 
-    fn debuginfo(&mut self, strip: Strip, _: &[PathBuf]) {
-        match strip {
-            Strip::None => {}
-            // FIXME: -s strips the symbol table, line number information
-            // and relocation information.
-            Strip::Debuginfo | Strip::Symbols => {
-                self.cmd.arg("-s");
-            }
-        }
-    }
+    fn debuginfo(&mut self, _: Strip, _: &[PathBuf]) {}
 
     fn no_crt_objects(&mut self) {}