Skip to content

Commit 09b634a

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

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)