Skip to content

Commit

Permalink
Add -mfloat-abi=hard as a default argument when using any arm/thumb-n…
Browse files Browse the repository at this point in the history
…one-eabihf target (#1194)

Fixes #1193.
  • Loading branch information
chrisnc committed Aug 26, 2024
1 parent ff5fc7a commit ad5d37b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2357,12 +2357,13 @@ impl Build {
cmd.args.push("-Wl,-melf_i386".into());
}

if (target.starts_with("arm") || target.starts_with("thumb"))
&& target.ends_with("-none-eabihf")
{
cmd.args.push("-mfloat-abi=hard".into())
}
if target.starts_with("thumb") {
cmd.args.push("-mthumb".into());

if target.ends_with("eabihf") {
cmd.args.push("-mfloat-abi=hard".into())
}
}
if target.starts_with("thumbv6m") {
cmd.args.push("-march=armv6s-m".into());
Expand Down Expand Up @@ -2401,15 +2402,9 @@ impl Build {
cmd.args.push("-march=armv7-r".into());

if target.ends_with("eabihf") {
// Calling convention
cmd.args.push("-mfloat-abi=hard".into());

// lowest common denominator FPU
// (see Cortex-R4 technical reference manual)
cmd.args.push("-mfpu=vfpv3-d16".into())
} else {
// Calling convention
cmd.args.push("-mfloat-abi=soft".into());
}
}
if target.starts_with("armv7a") {
Expand Down

0 comments on commit ad5d37b

Please sign in to comment.