-
Notifications
You must be signed in to change notification settings - Fork 13k
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 --eh-frame-hdr on linux-musl target & ld.lld linker flavour #73483
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The --eh-frame-hdr is necessary for unwinding but not enabled by default when using ld.lld linker flavour. Enable it to match existing behaviour for gcc linker flavour.
I'm not sure this will work as expected because non-baremetal targets don't really support linking with a "naked" linker (as opposed to the What the author of #73451 wanted to do is actually |
I know that this approach doesn't work with linux-gnu targets for reasons you |
It works with musl, but only in self-contained mode (see #68887 (comment) for details), which should ideally be enabled only when a native musl toolchain is nowhere in sight. I wouldn't want to make it work today just break it tomorrow by changing the self-contained mode heuristic. |
Speaking of |
It is already possible to use So, what do you propose?
|
Just to clarify, I'd like to be able to cross-compile from Windows. |
Let's try
(Closing in favor of #73564.) |
linker: Create GNU_EH_FRAME header by default when producing ELFs Do it in a centralized way in `link.rs` instead of individual target specs. The opt-out is `-Clink-arg=(-Wl,)--no-eh-frame-hdr` if necessary. Fixes rust-lang#73451 cc rust-lang#73483
linker: Create GNU_EH_FRAME header by default when producing ELFs Do it in a centralized way in `link.rs` instead of individual target specs. The opt-out is `-Clink-arg=(-Wl,)--no-eh-frame-hdr` if necessary. Fixes rust-lang#73451 cc rust-lang#73483
linker: Create GNU_EH_FRAME header by default when producing ELFs Do it in a centralized way in `link.rs` instead of individual target specs. The opt-out is `-Clink-arg=(-Wl,)--no-eh-frame-hdr` if necessary. Fixes rust-lang#73451 cc rust-lang#73483
The --eh-frame-hdr is necessary for unwinding but not enabled by default
when using lld.ld linker flavour. Enable it to match existing behaviour
for gcc linker flavour.
Closes #73451.