Description
I've recently created a crate that provides IO/microcontroller specific constants to Rust programs written for the AVR architecture.
avrd on GitHub
avrd on Docs.rs
I've made it so that there is always a current
module in the crate root that reexports all items from a microcontroller-specific crate, depending on what CPU is being targeted.
In order to achieve this, I needed to add a target_cpu
conditional compilation flag to my fork of the Rust compiler
I would like to upstream this (with cleanups like more documentation), as it seems generally useful, but it also would make it easier to merge the fork into mainline if that were to ever happen in the future. On top of this, it would be quite a useful feature to other people who fork Rust for more esoteric architectures.
The in-tree targets don't seem to specify CPUs most of the time - looking in the librustc_back
module, it looks like some targets set CPU to cortex-a8
, some to a CPU name used by Sparc, but almost everything else is left blank, generic, or "x86_64", etc.
Before I file a PR, are there any glaring objections to this?