summaryrefslogtreecommitdiff
path: root/firmware/export/config.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2023-03-23 18:16:15 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-03-23 18:16:33 +0000
commit58b2e457824dc93916233627b98614409e5f258d (patch)
tree67c485a7881745574d66ae10889c2da331ba68c0 /firmware/export/config.h
parent86429dbf1eca8ee0e08176997f508647c3abf6bd (diff)
downloadrockbox-58b2e457824dc93916233627b98614409e5f258d.tar.gz
rockbox-58b2e457824dc93916233627b98614409e5f258d.zip
Fix unified syntax in ARM inline assembly
GCC 4.9 always emits assembly with divided syntax. Setting unified syntax in inline assembly causes the assembler to complain about GCC's generated code, because the directive extends past the scope of the inline asm. Fix this by setting divided mode at the end of the inline assembly block. The assembler directives are hidden behind macros because later versions of GCC won't need this workaround: they can be told to use the unified syntax with -masm-syntax-unified. Change-Id: Ic09e729e5bbb6fd44d08dac348daf6f55c75d7d8
Diffstat (limited to 'firmware/export/config.h')
-rw-r--r--firmware/export/config.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 19ee03b4c7..49cd6d610c 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -1005,6 +1005,16 @@ Lyre prototype 1 */
1005#define ROCKBOX_STRICT_ALIGN 1 1005#define ROCKBOX_STRICT_ALIGN 1
1006#endif 1006#endif
1007 1007
1008/*
1009 * These macros are for switching on unified syntax in inline assembly.
1010 * Older versions of GCC emit assembly in divided syntax with no option
1011 * to enable unified syntax.
1012 *
1013 * FIXME: This needs to be looked at after the toolchain bump
1014 */
1015#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n"
1016#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n"
1017
1008#if defined(CPU_ARM) && defined(__ASSEMBLER__) 1018#if defined(CPU_ARM) && defined(__ASSEMBLER__)
1009.syntax unified 1019.syntax unified
1010/* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */ 1020/* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */