From 8c86fb6da0b9c068ee4b4220dee11171e322f67f Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 24 May 2023 09:37:20 -0400 Subject: arm: Use -masm-syntax-unified when compiling with gcc8 or newer Annoyingly, this makes all of the '.S' files we compile get treated as divided syntax, so we need to make the syntax in them explicit. Change-Id: I56a3916b7b24c84a1214a5d6bc4ed4d651f002cf --- firmware/export/config.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'firmware/export/config.h') diff --git a/firmware/export/config.h b/firmware/export/config.h index 80d59ea836..9812db9161 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -1018,14 +1018,19 @@ Lyre prototype 1 */ * These macros are for switching on unified syntax in inline assembly. * Older versions of GCC emit assembly in divided syntax with no option * to enable unified syntax. - * - * FIXME: This needs to be looked at after the toolchain bump */ +#if (__GNUC__ < 8) #define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n" #define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n" +#else +#define BEGIN_ARM_ASM_SYNTAX_UNIFIED +#define END_ARM_ASM_SYNTAX_UNIFIED +#endif #if defined(CPU_ARM) && defined(__ASSEMBLER__) +#if (__GNUC__ < 8) .syntax unified +#endif /* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */ .macro ldmpc cond="", order="ia", regs #if ARM_ARCH == 4 && defined(USE_THUMB) @@ -1043,6 +1048,9 @@ Lyre prototype 1 */ ldr\cond pc, [sp], #4 #endif .endm +#if (__GNUC__ < 8) +.syntax divided +#endif #endif #if defined(CPU_COLDFIRE) && defined(__ASSEMBLER__) -- cgit v1.2.3