Skip to content

Commit 6831362

Browse files
authored
Rollup merge of #131480 - madsmtm:macos-fix-strip-binary, r=nnethercote
Fix hardcoded strip path when cross-compiling from Linux to Darwin Fixes#131206. I fear that #131405 might end up taking some time, so opening this PR to resolve the regression. `@rustbot` label O-apple
2 parents 173c50f + 09b634a commit 6831362

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • compiler/rustc_codegen_ssa/src/back

‎compiler/rustc_codegen_ssa/src/back/link.rs‎

Lines changed: 3 additions & 1 deletion
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 = ifcfg!(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)