From ac72fa6c126ef07727c2a7993083118e44093334 Mon Sep 17 00:00:00 2001 From: Hugues de Valon Date: Mon, 17 Dec 2018 16:50:27 +0000 Subject: [PATCH] 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. --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 471fee3..c3dd48a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1304,6 +1304,16 @@ impl Build { if target.starts_with("thumbv7m") { 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("armeb") { cmd.args.push("-mbig-endian".into()); @@ -1758,6 +1768,9 @@ impl Build { "thumbv7em-none-eabi" => Some("arm-none-eabi"), "thumbv7em-none-eabihf" => 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-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"), "x86_64-unknown-linux-musl" => Some("musl"),