Open roblabla opened 1 year ago
A coworker hit a weird case where Linux' strip
would actually break the Mach-O instead of bailing out, rendering it inoperable (dyld would choke trying to load it, claiming /usr/lib/libobjc.A.dylib
could not be found - which is obviously suspicious, as that lib is there on all darwin installs).
We finally tracked it down to this after a lot of trial and error, but this created a lot of confusion.
@rustbot label A-cross O-macos
Currently, when compiling for macOS with
-C strip=symbols
, rustc will try to invokestrip
on the output binary to remove its symbols. This, unfortunately, fails when cross-compiling from linux, as thestrip
binary on linux only understands ELF files and will choke on the mach-o. This results in the following warnings in the build logs, and an unstripped binary output:Ideally, rustc should either:
llvm-strip
(which is currently packaged in rustup as part of llvm-tools-preview, CC #85658)Reproduction steps:
Meta
rustc --version --verbose
: