Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /usr/bin/strip on macOS -> iOS cross as a temporary workaround #138250

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
@@ -1046,7 +1046,18 @@ fn link_natively(
let strip = sess.opts.cg.strip;

if sess.target.is_like_osx {
let stripcmd = "rust-objcopy";
let stripcmd = if sess.host.os == "macos" && sess.target.os != "macos" {
// FIXME(#138212): properly fix `llvm-objcopy` upstream when stripping iOS binaries
// (seemingly producing stripped binaries with incorrect offsets that fail platform
// consistency checks). This can only be used on macOS -> iOS cross because other linux
// hosts may not have a (good) system strip in this location.
//
// See upstream bug report <https://github.com/llvm/llvm-project/issues/130472>.
"/usr/bin/strip"
} else {
"rust-objcopy"
};

match (strip, crate_type) {
(Strip::Debuginfo, _) => {
strip_with_external_utility(sess, stripcmd, out_filename, &["--strip-debug"])
Loading