1
0
Fork 0
forked from len0rd/rockbox

arm: workaround to build Cortex-M7 targets with GCC 4.9

Cortex-M7 support was added in GCC 5, while GCC 4.9 only
supports the M4. The instruction set is almost identical
between both processors; the only difference is that the
M7 supports double-precision floating point and the M4
doesn't.

Since Rockbox currently doesn't use the FPU, building M7
targets as M4 works fine.

Change-Id: I5880d6e81a85fa9b3e16e08d57e7955b4493df0b
This commit is contained in:
Aidan MacDonald 2025-03-01 18:11:51 +01:00
parent da4e02cdd3
commit 1aa9f26b02
3 changed files with 13 additions and 2 deletions

10
tools/configure vendored
View file

@ -4617,6 +4617,16 @@ else
GCCOPTS="$GCCOPTS -Wno-expansion-to-defined -Wimplicit-fallthrough=0"
fi
case "$GCCOPTS" in
*-mcpu=cortex-m7*)
# Cortex-M7 support wasn't added until GCC 5. Since we don't use any
# M7-specific features, we can compile as Cortex-M4 when on GCC 4.9.
if test "$gccnum" -lt "500"; then
GCCOPTS=$(echo "$GCCOPTS" | sed -e "s/-mcpu=cortex-m7/-mcpu=cortex-m4 -mthumb/")
fi
;;
esac
case $prefix in
""|"$CROSS_COMPILE")
# simulator