Skip to content

Commit 3965579

Browse files
authored
Merge pull request #363 from hug-dev/armv8-m
Add the Armv8-M targets
2 parents bb09ed2 + 5efb75b commit 3965579

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: false
33

44
matrix:
55
include:
6-
- rust: 1.16.0
6+
- rust: 1.30.0
77
install:
88
script: cargo build
99
- rust: stable

src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,16 @@ impl Build {
13041304
if target.starts_with("thumbv7m") {
13051305
cmd.args.push("-march=armv7-m".into());
13061306
}
1307+
if target.starts_with("thumbv8m.base") {
1308+
cmd.args.push("-march=armv8-m.base".into());
1309+
}
1310+
if target.starts_with("thumbv8m.main") {
1311+
cmd.args.push("-march=armv8-m.main".into());
1312+
1313+
if target.ends_with("eabihf") {
1314+
cmd.args.push("-mfpu=fpv5-sp-d16".into())
1315+
}
1316+
}
13071317
if target.starts_with("armebv7r") | target.starts_with("armv7r") {
13081318
if target.starts_with("armeb") {
13091319
cmd.args.push("-mbig-endian".into());
@@ -1709,7 +1719,7 @@ impl Build {
17091719
} else if self.get_host()? != target {
17101720
// CROSS_COMPILE is of the form: "arm-linux-gnueabi-"
17111721
let cc_env = self.getenv("CROSS_COMPILE");
1712-
let cross_compile = cc_env.as_ref().map(|s| s.trim_right_matches('-'));
1722+
let cross_compile = cc_env.as_ref().map(|s| s.trim_end_matches('-'));
17131723
let prefix = cross_compile.or(match &target[..] {
17141724
"aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"),
17151725
"aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"),
@@ -1758,6 +1768,9 @@ impl Build {
17581768
"thumbv7em-none-eabi" => Some("arm-none-eabi"),
17591769
"thumbv7em-none-eabihf" => Some("arm-none-eabi"),
17601770
"thumbv7m-none-eabi" => Some("arm-none-eabi"),
1771+
"thumbv8m.base-none-eabi" => Some("arm-none-eabi"),
1772+
"thumbv8m.main-none-eabi" => Some("arm-none-eabi"),
1773+
"thumbv8m.main-none-eabihf" => Some("arm-none-eabi"),
17611774
"x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"),
17621775
"x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"),
17631776
"x86_64-unknown-linux-musl" => Some("musl"),

src/windows_registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ mod impl_ {
637637
for subkey in key.iter().filter_map(|k| k.ok()) {
638638
let val = subkey
639639
.to_str()
640-
.and_then(|s| s.trim_left_matches("v").replace(".", "").parse().ok());
640+
.and_then(|s| s.trim_start_matches("v").replace(".", "").parse().ok());
641641
let val = match val {
642642
Some(s) => s,
643643
None => continue,

0 commit comments

Comments
 (0)