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] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target #74941

Merged

Commits on Aug 24, 2020

  1. [AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-g…

    …nu-atmega328' target
    
    The `avr-unknown-unknown` target has never worked correctly, always trying to invoke
    the host linker and failing. It aimed to be a mirror of AVR-GCC's
    default handling of the `avr-unknown-unknown' triple (assume bare
    minimum chip features, silently skip linking runtime libraries, etc).
    This behaviour is broken-by-default as it will cause a miscompiled executable
    when flashed.
    
    This patch improves the AVR builtin target specifications to instead
    expose only a 'avr-unknown-gnu-atmega328' target. This target system is
    `gnu`, as it uses the AVR-GCC frontend along with avr-binutils. The
    target triple ABI is 'atmega328'.
    
    In the future, it should be possible to replace the dependency on
    AVR-GCC and binutils by using the in-progress AVR LLD and compiler-rt support.
    Perhaps at that point it would make sense to add an
    'avr-unknown-unknown-atmega328' target as a better default when
    implemented.
    
    There is no current intention to add in-tree AVR target specifications for other
    AVR microcontrollers - this one can serve as a reference implementation
    for other devices via `rustc --print target-spec-json
    avr-unknown-gnu-atmega328p`.
    
    There should be no users of the existing 'avr-unknown-unknown' Rust
    target as a custom target specification JSON has always been
    recommended, and the avr-unknown-unknown target could never pass the
    linking step anyway.
    dylanmckay committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    d785f9b View commit details
    Browse the repository at this point in the history
  2. [AVR] Remove unnecessary arguments passed to the linker for GNU target

    In general, linking with libc is not required, only libgcc is needed.
    As suggested in the code review, a better option for libc support is by
    building it into rust-lang/libc directly.
    
    This also removes the '-Os' argument to the linker, which is a NOP.
    dylanmckay committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    53b940c View commit details
    Browse the repository at this point in the history
  3. [AVR] Merge the 'freestanding' base target spec into AVR base target …

    …spec
    
    The 'freestanding' module was only ever used for AVR. It was an
    unnecessary layer of abstraction. This commit merges the
    'freestanding_base' module into 'avr_gnu_base'.
    dylanmckay committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    dc20238 View commit details
    Browse the repository at this point in the history
  4. [AVR] Rename the last few remaining references from 'avr-unknown-unkn…

    …own' to 'avr-unknown-gnu-atmega328'
    dylanmckay committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    a0905ce View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c9ead8c View commit details
    Browse the repository at this point in the history