Skip to content

Commit ad5d37b

Browse files
authored
Add -mfloat-abi=hard as a default argument when using any arm/thumb-none-eabihf target (#1194)
Fixes #1193.
1 parent ff5fc7a commit ad5d37b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,12 +2357,13 @@ impl Build {
23572357
cmd.args.push("-Wl,-melf_i386".into());
23582358
}
23592359

2360+
if (target.starts_with("arm") || target.starts_with("thumb"))
2361+
&& target.ends_with("-none-eabihf")
2362+
{
2363+
cmd.args.push("-mfloat-abi=hard".into())
2364+
}
23602365
if target.starts_with("thumb") {
23612366
cmd.args.push("-mthumb".into());
2362-
2363-
if target.ends_with("eabihf") {
2364-
cmd.args.push("-mfloat-abi=hard".into())
2365-
}
23662367
}
23672368
if target.starts_with("thumbv6m") {
23682369
cmd.args.push("-march=armv6s-m".into());
@@ -2401,15 +2402,9 @@ impl Build {
24012402
cmd.args.push("-march=armv7-r".into());
24022403

24032404
if target.ends_with("eabihf") {
2404-
// Calling convention
2405-
cmd.args.push("-mfloat-abi=hard".into());
2406-
24072405
// lowest common denominator FPU
24082406
// (see Cortex-R4 technical reference manual)
24092407
cmd.args.push("-mfpu=vfpv3-d16".into())
2410-
} else {
2411-
// Calling convention
2412-
cmd.args.push("-mfloat-abi=soft".into());
24132408
}
24142409
}
24152410
if target.starts_with("armv7a") {

0 commit comments

Comments
 (0)