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

[AVR] Disable passing of he '--eh-frame-hdr' argument to the linker #74625

Conversation

dylanmckay
Copy link
Contributor

In general, the GNU AVR linker that is distributed does not support this flag.
On Arch Linux, the most recently distributed version of avr-ld
corresponds to binutils 2.34, which is the most recent version of
binutils as of today (2020-07-22), however - it still does not list
this argument in its --help list compared to the host LD, which does.

As AVR has no exception handling support, the exception handling frame header
argument is redundant. This patch disables passing of the '--eh-frame-hdr' argument
to avr-ld, similar to the existing exclusions (i.e. Windows, Solaris,
UEFI).

In general, the GNU AVR linker that is distributed does not support this flag.
On Arch Linux, the most recently distributed version of avr-ld
corresponds to binutils 2.34, which is the most recent version of
binutils as of today (2020-07-22), however - it still does not list
this argument in its --help list compared to the host LD, which does.

As AVR has no exception handling support, the exception handling frame header
argument is redundant. This patch disables passing of the '--eh-frame-hdr' argument
to avr-ld, similar to the existing exclusions (i.e. Windows, Solaris,
UEFI).
@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2020
@dylanmckay
Copy link
Contributor Author

dylanmckay commented Jul 22, 2020

I'm not sure how to test this one without invoking the GNU AVR linker directly in a test whose purpose is simply to go through the whole processed and be linked correctly. It doesn't feel right to assume the presence of an esoteric GNU linker in the Rust compile suite. This change is fairly small and low risk so it may be fine to go through without an explicit test. Advice and thoughts appreciated.

@jonas-schievink jonas-schievink added the O-AVR Target: AVR processors (ATtiny, ATmega, etc.) label Jul 22, 2020
@petrochenkov
Copy link
Contributor

Ok, it's not the first --eh-frame-hdr-related reported regression (#73564 (comment), #74167) and at this point we need a target-spec flag for this instead of hard-coding in linker.rs.
I think I'll do this right now and send a PR.

@petrochenkov
Copy link
Contributor

Superseded by #74631.

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 22, 2020
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
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 22, 2020
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
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 22, 2020
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
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 22, 2020
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
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 22, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-AVR Target: AVR processors (ATtiny, ATmega, etc.) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants