-
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
linker: Create GNU_EH_FRAME header by default when producing ELFs #73564
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Some questions:
|
We still need it with unwind=abort because backtraces need unwind info. |
@bors r+ |
📌 Commit 79a42e3 has been approved by |
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
…arth Rollup of 10 pull requests Successful merges: - rust-lang#73414 (Implement `slice_strip` feature) - rust-lang#73564 (linker: Create GNU_EH_FRAME header by default when producing ELFs) - rust-lang#73622 (Deny unsafe ops in unsafe fns in libcore) - rust-lang#73684 (add spans to injected coverage counters, extract with CoverageData query) - rust-lang#73812 (ast_pretty: Pass some token streams and trees by reference) - rust-lang#73853 (Add newline to rustc MultiSpan docs) - rust-lang#73883 (Compile rustdoc less often.) - rust-lang#73885 (Fix wasm32 being broken due to a NodeJS version bump) - rust-lang#73903 (Changes required for rustc/cargo to build for iOS targets) - rust-lang#73938 (Optimise fast path of checked_ops with `unlikely`) Failed merges: r? @ghost
As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
FYI: This breaks, at least, bare-metal Rust RISC-V projects. GNU Binutils doesn't support I'm commenting here in case anyone else finds their Rust-RISC-V-Binutils toolchain suddenly breaks. I was previously using |
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
…-fix, r=petrochenkov linker: illumos ld does not support --eh-frame-hdr As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
62: Preserve .eh_frame and .eh_frame_hdr r=almindor a=Disasm Preserving the `.eh_frame` section improves gdb stack traces on nightly. Preserving the `.eh_frame_hdr` section fixes the linker problem `rust-lld: error: no memory region specified for section '.eh_frame_hdr'` introduced in rust-lang/rust#73564 Co-authored-by: Vadim Kaushan <admin@disasm.info>
As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally passed to linkers on many platforms. The illumos link editor does not currently support this flag. The linker machinery in the Rust toolchain currently seems to use the (potentially cross-compiled) target to choose linker flags, rather than looking at what might be running on the build system. Disabling the flag for all illumos/Solaris targets seems like the best we can do for now without more serious surgery.
@diodesign |
rustc_target: Add a target spec option for disabling `--eh-frame-hdr` Disable `--eh-frame-hdr` for targets that use an `ld`-like linker, but don't support that option. Do it through a target spec option rather than through hard-coding in `linker.rs`. The option is still enabled by default though. cc rust-lang#73564 Fixes rust-lang#73564 (comment) Fixes rust-lang#74625 Fixes rust-embedded/msp430-rt#12
rustc_target: Add a target spec option for disabling `--eh-frame-hdr` Disable `--eh-frame-hdr` for targets that use an `ld`-like linker, but don't support that option. Do it through a target spec option rather than through hard-coding in `linker.rs`. The option is still enabled by default though. cc rust-lang#73564 Fixes rust-lang#73564 (comment) Fixes rust-lang#74625 Fixes rust-embedded/msp430-rt#12
rustc_target: Add a target spec option for disabling `--eh-frame-hdr` Disable `--eh-frame-hdr` for targets that use an `ld`-like linker, but don't support that option. Do it through a target spec option rather than through hard-coding in `linker.rs`. The option is still enabled by default though. cc rust-lang#73564 Fixes rust-lang#73564 (comment) Fixes rust-lang#74625 Fixes rust-embedded/msp430-rt#12
rustc_target: Add a target spec option for disabling `--eh-frame-hdr` Disable `--eh-frame-hdr` for targets that use an `ld`-like linker, but don't support that option. Do it through a target spec option rather than through hard-coding in `linker.rs`. The option is still enabled by default though. cc rust-lang#73564 Fixes rust-lang#73564 (comment) Fixes rust-lang#74625 Fixes rust-embedded/msp430-rt#12
rustc_target: Add a target spec option for disabling `--eh-frame-hdr` Disable `--eh-frame-hdr` for targets that use an `ld`-like linker, but don't support that option. Do it through a target spec option rather than through hard-coding in `linker.rs`. The option is still enabled by default though. cc rust-lang#73564 Fixes rust-lang#73564 (comment) Fixes rust-lang#74625 Fixes rust-embedded/msp430-rt#12
62: Preserve .eh_frame and .eh_frame_hdr r=almindor a=Disasm Preserving the `.eh_frame` section improves gdb stack traces on nightly. Preserving the `.eh_frame_hdr` section fixes the linker problem `rust-lld: error: no memory region specified for section '.eh_frame_hdr'` introduced in rust-lang/rust#73564 Co-authored-by: Vadim Kaushan <admin@disasm.info>
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 #73451
cc #73483