Closed
Description
The Rust compiler supports the Cortex-M architecture but this doesn't work out of the box:
$ cargo build --target thumbv6m-none-eabi
for two reasons:
thumbv6m-none-eabi
is not a "built-in" target so you have to supply your own target definition.cargo build
doesn't compile the standard crates and there's no binary release of the standard
crates for this target.
The upstream solution is to either:
- Add the thumb targets to the compiler and also provide binary releases of the standard crates
for them. Or, - Just add the targets and teach Cargo how to build the standard libraries "on the fly".
This is being worked on. Seems like the Rust team is leaning towards the second solution. You can
track the upstream status in:
- Make Cargo aware of standard library dependencies rust-lang/rfcs#1133 Teach Cargo how to build the standard crates on the fly
- Add Cortex-M targets to the compiler + binary releases of
core
rust-lang/rfcs#1645 Add the thumb targets