Browse Source

Add the Armv8-M targets

This commit adds the Armv8-M targets recently added into Rust:
* Armv8-M Baseline ("thumbv8m.base-none-eabi")
* Armv8-M Mainline ("thumbv8m.main-none-eabi")
* Armv8-M Mainline with FPU extension ("thumbv8m.main-none-eabihf")

The FPU chosen for the hardfloat variant of Armv8-M Mainline is the one
available in the Cortex-M33 processor: single precision, FPv5
architecture.
It is described in the Arm Cortex-M33 Processor Technical Reference
Manual on the page 64.
wasi
Hugues de Valon 6 years ago
parent
commit
ac72fa6c12
  1. 13
      src/lib.rs

13
src/lib.rs

@ -1304,6 +1304,16 @@ impl Build {
if target.starts_with("thumbv7m") { if target.starts_with("thumbv7m") {
cmd.args.push("-march=armv7-m".into()); cmd.args.push("-march=armv7-m".into());
} }
if target.starts_with("thumbv8m.base") {
cmd.args.push("-march=armv8-m.base".into());
}
if target.starts_with("thumbv8m.main") {
cmd.args.push("-march=armv8-m.main".into());
if target.ends_with("eabihf") {
cmd.args.push("-mfpu=fpv5-sp-d16".into())
}
}
if target.starts_with("armebv7r") | target.starts_with("armv7r") { if target.starts_with("armebv7r") | target.starts_with("armv7r") {
if target.starts_with("armeb") { if target.starts_with("armeb") {
cmd.args.push("-mbig-endian".into()); cmd.args.push("-mbig-endian".into());
@ -1758,6 +1768,9 @@ impl Build {
"thumbv7em-none-eabi" => Some("arm-none-eabi"), "thumbv7em-none-eabi" => Some("arm-none-eabi"),
"thumbv7em-none-eabihf" => Some("arm-none-eabi"), "thumbv7em-none-eabihf" => Some("arm-none-eabi"),
"thumbv7m-none-eabi" => Some("arm-none-eabi"), "thumbv7m-none-eabi" => Some("arm-none-eabi"),
"thumbv8m.base-none-eabi" => Some("arm-none-eabi"),
"thumbv8m.main-none-eabi" => Some("arm-none-eabi"),
"thumbv8m.main-none-eabihf" => Some("arm-none-eabi"),
"x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"), "x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
"x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"), "x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
"x86_64-unknown-linux-musl" => Some("musl"), "x86_64-unknown-linux-musl" => Some("musl"),

Loading…
Cancel
Save