Skip to content

Commit 1fcbe88

Browse files
authored
Merge pull request #339 from japaric/cortex-r
add support for Cortex-R devices
2 parents cdd5988 + e93e513 commit 1fcbe88

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/lib.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,31 @@ impl Build {
12621262
if target.starts_with("thumbv7m") {
12631263
cmd.args.push("-march=armv7-m".into());
12641264
}
1265+
if target.starts_with("armebv7r") | target.starts_with("armv7r") {
1266+
if target.starts_with("armeb") {
1267+
cmd.args.push("-mbig-endian".into());
1268+
} else {
1269+
cmd.args.push("-mlittle-endian".into());
1270+
}
1271+
1272+
// ARM mode
1273+
cmd.args.push("-marm".into());
1274+
1275+
// R Profile
1276+
cmd.args.push("-march=armv7-r".into());
1277+
1278+
if target.ends_with("eabihf") {
1279+
// Calling convention
1280+
cmd.args.push("-mfloat-abi=hard".into());
1281+
1282+
// lowest common denominator FPU
1283+
// (see Cortex-R4 technical reference manual)
1284+
cmd.args.push("-mfpu=vfpv3-d16".into())
1285+
} else {
1286+
// Calling convention
1287+
cmd.args.push("-mfloat-abi=soft".into());
1288+
}
1289+
}
12651290
}
12661291
}
12671292

@@ -1672,6 +1697,9 @@ impl Build {
16721697
"sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"),
16731698
"sparc64-unknown-netbsd" => Some("sparc64--netbsd"),
16741699
"sparcv9-sun-solaris" => Some("sparcv9-sun-solaris"),
1700+
"armebv7r-none-eabihf" => Some("arm-none-eabi"),
1701+
"armv7r-none-eabi" => Some("arm-none-eabi"),
1702+
"armv7r-none-eabihf" => Some("arm-none-eabi"),
16751703
"thumbv6m-none-eabi" => Some("arm-none-eabi"),
16761704
"thumbv7em-none-eabi" => Some("arm-none-eabi"),
16771705
"thumbv7em-none-eabihf" => Some("arm-none-eabi"),

0 commit comments

Comments
 (0)