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

View file

@ -1075,7 +1075,7 @@ Lyre prototype 1 */
* Older versions of GCC emit assembly in divided syntax with no option * Older versions of GCC emit assembly in divided syntax with no option
* to enable unified syntax. * to enable unified syntax.
*/ */
#if (__GNUC__ < 8) #if (__GNUC__ < 8) && defined(CPU_ARM_CLASSIC)
#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n" #define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n"
#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n" #define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n"
#else #else

View file

@ -460,7 +460,8 @@ void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSR][64],
p_buf_1 = qmfs->v + qmfs->v_index; p_buf_1 = qmfs->v + qmfs->v_index;
/* calculate 64 output samples and window */ /* calculate 64 output samples and window */
#ifdef CPU_ARM /* note: GCC 4.9 complains about the inline asm on Cortex-M targets */
#if defined(CPU_ARM_CLASSIC) || (defined(CPU_ARM_MICRO) && __GNUC__ > 4)
const real_t *qtab = qmf_c; const real_t *qtab = qmf_c;
real_t *pbuf = p_buf_1; real_t *pbuf = p_buf_1;
for (k = 0; k < 64; k++, pbuf++) for (k = 0; k < 64; k++, pbuf++)

10
tools/configure vendored
View file

@ -4617,6 +4617,16 @@ else
GCCOPTS="$GCCOPTS -Wno-expansion-to-defined -Wimplicit-fallthrough=0" GCCOPTS="$GCCOPTS -Wno-expansion-to-defined -Wimplicit-fallthrough=0"
fi 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 case $prefix in
""|"$CROSS_COMPILE") ""|"$CROSS_COMPILE")
# simulator # simulator