Skip to content

Commit

Permalink
Rollup merge of #131171 - madsmtm:target-info-avr-env, r=petrochenkov
Browse files Browse the repository at this point in the history
Fix `target_env` in `avr-unknown-gnu-atmega328`

The target name itself contains GNU, we should probably reflect that as `target_env = "gnu"` as well? Or from my reading of #74941 (comment), perhaps not, but then that should probably be documented somewhere?

There's no listed target maintainer, but the target was introduced in #74941, so I'll ping the author of that: `@dylanmckay`

Relatedly, I wonder _why_ the recommendation is to [create separate target triples for each AVR](https://github.com/Rahix/avr-hal/tree/main/avr-specs), when `-Ctarget-cpu=...` would suffice, perhaps you could also elaborate on that? Was it just because `-Ctarget-cpu=...` didn't exist back then? If so, now that it does, should we now change the target back to e.g. `avr-unknown-none-gnu`, and require the user to set `-Ctarget-cpu=...` instead?
  • Loading branch information
workingjubilee authored Oct 4, 2024
2 parents 554daa0 + 033fdda commit ff57e0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_target/src/spec/base/avr_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub(crate) fn target(target_cpu: &'static str, mmcu: &'static str) -> Target {
llvm_target: "avr-unknown-unknown".into(),
pointer_width: 16,
options: TargetOptions {
env: "gnu".into(),

c_int_width: "16".into(),
cpu: target_cpu.into(),
exe_suffix: ".elf".into(),
Expand Down

0 comments on commit ff57e0b

Please sign in to comment.