From ac72fa6c126ef07727c2a7993083118e44093334 Mon Sep 17 00:00:00 2001 From: Hugues de Valon Date: Mon, 17 Dec 2018 16:50:27 +0000 Subject: [PATCH 1/4] 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"), From 439305190ffbc32ed06f1f9db442f120d3cec7f4 Mon Sep 17 00:00:00 2001 From: Hugues de Valon Date: Mon, 17 Dec 2018 16:56:22 +0000 Subject: [PATCH 2/4] Replace future deprecated call The trim_right_matches method is deprecating in 1.33 in favor of trim_end_matches (see rust-lang/rust#52994). --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c3dd48a..6a9081f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1719,7 +1719,7 @@ impl Build { } else if self.get_host()? != target { // CROSS_COMPILE is of the form: "arm-linux-gnueabi-" let cc_env = self.getenv("CROSS_COMPILE"); - let cross_compile = cc_env.as_ref().map(|s| s.trim_right_matches('-')); + let cross_compile = cc_env.as_ref().map(|s| s.trim_end_matches('-')); let prefix = cross_compile.or(match &target[..] { "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"), "aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"), From 228513449f3e2674cdce0f53206c9449af9d3778 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 18 Dec 2018 07:19:04 -0800 Subject: [PATCH 3/4] Update minimum version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 47bbfd8..b28b0e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: false matrix: include: - - rust: 1.16.0 + - rust: 1.30.0 install: script: cargo build - rust: stable From 5efb75b2cc8b2f6822a7239e50292b8f6dce403d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 18 Dec 2018 07:19:45 -0800 Subject: [PATCH 4/4] Fix a deprecation on Windows --- src/windows_registry.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/windows_registry.rs b/src/windows_registry.rs index c82f09b..ca6b989 100644 --- a/src/windows_registry.rs +++ b/src/windows_registry.rs @@ -637,7 +637,7 @@ mod impl_ { for subkey in key.iter().filter_map(|k| k.ok()) { let val = subkey .to_str() - .and_then(|s| s.trim_left_matches("v").replace(".", "").parse().ok()); + .and_then(|s| s.trim_start_matches("v").replace(".", "").parse().ok()); let val = match val { Some(s) => s, None => continue,