Skip to content

Commit

Permalink
Fix hardcoded strip path when cross-compiling from Linux to Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Oct 10, 2024
1 parent fc0f045 commit 09b634a
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 09b634a

Please sign in to comment.