-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Hard-coded strip
path breaks Linux -> Darwin builds
#131206
Comments
(The results are not exactly the same, but things are broken for the same cause.) |
pin to version before rust-lang-ci/rust@0399709 rust-lang/rust#130781 rust-lang/rust#131206 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
pin to version before rust-lang-ci/rust@0399709 rust-lang/rust#130781 rust-lang/rust#131206 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Oh, sorry, I missed the information that that used to work. (In any case, I think the correct solution to these problems is the same one: #123151) |
indeed, LLVM Will #123151 land before 1.83? I don't think #130781 should land in a release and seems that it currently targets 1.83 |
pin to version before rust-lang-ci/rust@0399709 rust-lang/rust#130781 rust-lang/rust#131206 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
#130781 cc @monkeydbobo and @davidtwco |
Also check that the host is darwin too? |
how hard is it to implement "our own" (based on crates) Mach-O stripping instead of using the command? Using the |
If you are using binutils strip to strip arm64 macOS binaries, it does not work fine. It produces broken binaries with invalid code signature. On arm64 macOS mandates the use of code signatures, so "unsigned" binaries use an ad-hoc code signature, but binutils seems to forget to update the ad-hoc code signature when modifying binaries. This is exactly the problem #130781 fixed by forcing XCode's strip to be used instead. |
I have been compiling Mac binaries on Linux for over a year now and I originally have experienced code signatures being broken by GNU strip on aarch64 darwin binaries myself ( IIRC it only happens for binaries that require particular MacOS frameworks). I just tried to use 2 different
For reference:
LLVM strip:
So clearly LLVM |
Ah, right. LLVM's strip should work fine. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
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
…=jieyouxu,albertlarsan68 bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip Fixes rust-lang#131206. - Includes `llvm-strip` (a symlink to `llvm-objcopy`) in the compiler dist artifact so that it can be used for `-Cstrip` instead of the system tooling. - Uses `llvm-strip` instead of `/usr/bin/strip` for macOS. macOS needs a specific linker and the system one is preferred, hence rust-lang#130781 but that doesn't work when cross-compiling, so use the `llvm-strip` utility instead. cc rust-lang#123151
Rollup merge of rust-lang#131405 - davidtwco:hardcoded-strip-macos, r=jieyouxu,albertlarsan68 bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip Fixes rust-lang#131206. - Includes `llvm-strip` (a symlink to `llvm-objcopy`) in the compiler dist artifact so that it can be used for `-Cstrip` instead of the system tooling. - Uses `llvm-strip` instead of `/usr/bin/strip` for macOS. macOS needs a specific linker and the system one is preferred, hence rust-lang#130781 but that doesn't work when cross-compiling, so use the `llvm-strip` utility instead. cc rust-lang#123151
I cross-compile code for Darwin from Linux, which now fails due to the
strip
path being hard-coded in latest nightly, which I believe is caused by this PR #130781I expected to see this happen: successful compilation
Instead, this happened:
https://github.com/rvolosatovs/nixify/actions/runs/11163623704/job/31031050404?pr=265
I'm not sure why
/usr/bin/strip
was chosen as thestrip
to use, as an end user - that is surprising, in fact I would have expected thestrip
from the environment to be used by default. If the intention is to set a default to a hardcoded path, then it looks like a configuration option must be provided.Alternatively, perhaps
cargo
could use/usr/bin/strip
if found and otherwise usestrip
from environment?Version it worked on
It most recently worked on: 1.80.1
Version with regression
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: