Skip to content

Commit d4e078e

Browse files
committed
Auto merge of rust-lang#74941 - dylanmckay:replace-broken-avr-unknown-unknown-target, r=oli-obk
[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-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.
2 parents 280494e + 6cb5327 commit d4e078e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

panic_unwind/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ cfg_if::cfg_if! {
6565
// - os=none ("bare metal" targets)
6666
// - os=uefi
6767
// - nvptx64-nvidia-cuda
68-
// - avr-unknown-unknown
68+
// - arch=avr
6969
#[path = "dummy.rs"]
7070
mod real_imp;
7171
}

std/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn main() {
8383
// - os=none ("bare metal" targets)
8484
// - mipsel-sony-psp
8585
// - nvptx64-nvidia-cuda
86-
// - avr-unknown-unknown
86+
// - arch=avr
8787
// - tvos (aarch64-apple-tvos, x86_64-apple-tvos)
8888
// - uefi (x86_64-unknown-uefi, i686-unknown-uefi)
8989
// - JSON targets

0 commit comments

Comments
 (0)