Skip to content

Commit b2f6b14

Browse files
authored
Fix armhf build for GCC-11 (#627)
GCC 11 changed the default flag to put the FP option in the -march flag (arm7-a+fp) rather than a specific FPU flag. Therefore it needs to be given separately now. See https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1939379 for some more details.
1 parent 1e59593 commit b2f6b14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,11 @@ impl Build {
16381638
&& (target.contains("-linux-") || target.contains("-kmc-solid_"))
16391639
{
16401640
cmd.args.push("-march=armv7-a".into());
1641+
1642+
if target.ends_with("eabihf") {
1643+
// lowest common denominator FPU
1644+
cmd.args.push("-mfpu=vfpv3-d16".into());
1645+
}
16411646
}
16421647

16431648
// (x86 Android doesn't say "eabi")

0 commit comments

Comments
 (0)