about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authormonkeydbobo <monkeydbobo@zju.edu.cn>2024-09-24 19:51:11 +0800
committermonkeydbobo <monkeydbobo@zju.edu.cn>2024-09-24 19:51:11 +0800
commit802bf71ece2b2ae41ba39068a8a7533544fc1106 (patch)
tree6eda71d53c6fac6f832f9bfc7453f5ec034d5205 /compiler/rustc_codegen_ssa
parent4cadeda932d5c261a9a0b1bbd25c4486e4e0a4c6 (diff)
downloadrust-802bf71ece2b2ae41ba39068a8a7533544fc1106.tar.gz
rust-802bf71ece2b2ae41ba39068a8a7533544fc1106.zip
Fix up setting strip = true in Cargo.toml makes build scripts fail in release mode on MacOS
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 892dfb91201..69693230ce0 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1087,16 +1087,17 @@ fn link_natively(
     let strip = sess.opts.cg.strip;
 
     if sess.target.is_like_osx {
+        let stripcmd = "/usr/bin/strip";
         match (strip, crate_type) {
             (Strip::Debuginfo, _) => {
-                strip_symbols_with_external_utility(sess, "strip", out_filename, Some("-S"))
+                strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-S"))
             }
             // Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
             (Strip::Symbols, CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro) => {
-                strip_symbols_with_external_utility(sess, "strip", out_filename, Some("-x"))
+                strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-x"))
             }
             (Strip::Symbols, _) => {
-                strip_symbols_with_external_utility(sess, "strip", out_filename, None)
+                strip_symbols_with_external_utility(sess, stripcmd, out_filename, None)
             }
             (Strip::None, _) => {}
         }