Skip to content

Commit 09b634a

Browse files
committed
Fix hardcoded strip path when cross-compiling from Linux to Darwin
1 parent fc0f045 commit 09b634a

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,9 @@ fn link_natively(
10871087
let strip = sess.opts.cg.strip;
10881088

10891089
if sess.target.is_like_osx {
1090-
let stripcmd = "/usr/bin/strip";
1090+
// Use system `strip` when running on host macOS.
1091+
// <https://github.com/rust-lang/rust/pull/130781>
1092+
let stripcmd = if cfg!(target_os = "macos") { "/usr/bin/strip" } else { "strip" };
10911093
match (strip, crate_type) {
10921094
(Strip::Debuginfo, _) => {
10931095
strip_symbols_with_external_utility(sess, stripcmd, out_filename, Some("-S"))

0 commit comments

Comments
 (0)