Description
This is a P-high embedded-WG issue that needs to be fixed to make embedded Rust work on stable.
Targets like thumbv7m-none-eabi
need to use Xargo, which requires nightly, because there's no
pre-compiled core
crate (i.e. rustup target add thumbv7m-none-eabi
doesn't work).
To fastest way to remove this nightly dependency is to provide a rust-std
component (pre-compiled
core) for the embedded targets. Then users would be able to use rustup target thumbv7m-none-eabi; cargo build --target thumbv7m-none-eabi
for embedded development.
The embedded targets rustc
currently supports are:
thumbv6m-none-eabi
thumbv7m-none-eabi
thumbv7em-none-eabi
thumbv7em-none-eabihf
msp430-none-elf
The Thumb targets have a more stable LLVM backend so we can commit to always building core
for
that target. The MSP430 backend is slightly less stable so we don't want to block the PR pipeline if
building core
for the MSP430 target breaks.
This issue can be split in two parts:
- Enabling
rust-std
builds for the 4 Thumb targets. Gating oncore
building for those targets.Create some mechanism to letcore
/std
build fail, and enablerust-std
builds for the
MSP430 target. We won't gate oncore
building for the MSP430 target.
cc @alexcrichton who can give more info about how to implement this
cc @pftbest
Activity
oli-obk commentedon Mar 26, 2018
cc @phil-opp
jamesmunns commentedon Mar 27, 2018
Part of this is also integrating CI for embedded targets, especially
cortex_m
/thumb
targetsNeed to define what needs to be tested, including possibly:
whitequark commentedon Mar 29, 2018
Are you sure it's "last resort"? IME nearly all embedded code is built with
-Os
(which is based on-O2
anyway).jamesmunns commentedon Mar 29, 2018
@whitequark sorry, "last resort" wasn't a very descriptive phrase. It was meant as a "last resort for someone trying to reduce their code size due to going over their target size limit when using
cargo run --release
".In context, we were talking about making a regression test that would gate Rust releases if the size increased dramatically for embedded targets. Initially we were planning to use a
--release
build for this, but there was pushback because of how LLVM can change version to version based on how aggressively it tries to unroll/inline. There was more support for basing this regression test on-Os
or-O2
, since that should have more consistent "small code size" behavior, and any large increases in binary size are likely due to some other issue.add a dist-thumb builder to build rust-std for the THUMB targets
japaric commentedon Apr 1, 2018
PR #49563 build rust-std for ARM Cortex-M.
necrose99 commentedon May 25, 2018
rustup target add aarch64-pc-windows-msvc
rustup target add armv7-pc-windows-msvc
rustup target add aarch64-pc-windows-gnu
rustup target add armv7-pc-windows-gnu
rpi-3 windows 10 , rock64/pine64 windows 10 embedded...
3 remaining items