Skip to content

Commit

Permalink
Unrolled build for rust-lang#131480
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#131480 - madsmtm:macos-fix-strip-binary, r=nnethercote

Fix hardcoded strip path when cross-compiling from Linux to Darwin

Fixes rust-lang#131206.

I fear that rust-lang#131405 might end up taking some time, so opening this PR to resolve the regression.

`@rustbot` label O-apple
  • Loading branch information
rust-timer authored Oct 10, 2024
2 parents de19f2b + 09b634a commit 51cfba9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,9 @@ fn link_natively(
let strip = sess.opts.cg.strip;

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

0 comments on commit 51cfba9

Please sign in to comment.