Create an avr-unknown-unknown target #800
Labels
major-change
A proposal to make a major change to rustc
T-compiler
Add this label so rfcbot knows to poll the compiler team
to-announce
Announce this issue on triage meeting
Proposal
I'm proposing to remove the existing
avr-unknown-gnu-atmega328
target and replace it with a genericavr-unknown-unknown
variant. This variant can be then specialized for a specific CPU (well, microcontroller) using the-C target-cpu
flag, like so:Using the generic variant is the better approach in my opinion, because that's how LLVM already works.
In particular, at the moment rustc exposes only the
atmega328
target, but following the current logic we'd have to create ~three hundred targets more - for nothing, since-C target-cpu
(aka-mcpu
in LLVM) achieves the same thing.To avoid confusing people, I'm proposing to remove the current
avr-unknown-gnu-atmega328
target - it shouldn't be widely used in practice, because virtually all Rust+AVR tutorials and examples rely on target.jsons (see e.g. examples in avr-hal). If backwards compatibility for tier 3 targets is important though, we can think about providing a dedicated error message for people trying to use the older target.Implementation
This MCP is mostly implemented: rust-lang/rust#131651; I've created the MCP post factum, following @tgross35's idea.
The text was updated successfully, but these errors were encountered: