summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2023-05-24 09:37:20 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-05-08 21:45:42 -0400
commit8c86fb6da0b9c068ee4b4220dee11171e322f67f (patch)
tree35d458f5d8015f659593fb57df67b5e99afb5462
parent0a89d1d4df0d24f2b73888fe3c457679acfb48aa (diff)
downloadrockbox-8c86fb6da0b9c068ee4b4220dee11171e322f67f.tar.gz
rockbox-8c86fb6da0b9c068ee4b4220dee11171e322f67f.zip
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
-rw-r--r--apps/plugins/mpegplayer/libmpeg2/idct_arm.S2
-rw-r--r--apps/plugins/mpegplayer/libmpeg2/idct_armv6.S2
-rw-r--r--apps/recorder/jpeg_idct_arm.S2
-rw-r--r--firmware/asm/arm/lcd-as-memframe.S2
-rw-r--r--firmware/asm/arm/memcpy.S2
-rw-r--r--firmware/asm/arm/memmove.S2
-rw-r--r--firmware/asm/arm/memset.S2
-rw-r--r--firmware/asm/arm/memset16.S2
-rw-r--r--firmware/export/config.h12
-rw-r--r--firmware/target/arm/ata-as-arm.S1
-rw-r--r--lib/arm_support/support-arm.S2
-rw-r--r--lib/rbcodec/codecs/demac/libdemac/udiv32_arm.S3
-rw-r--r--lib/rbcodec/codecs/libtta/filter_arm.S2
-rw-r--r--lib/rbcodec/dsp/dsp_arm.S1
-rw-r--r--lib/rbcodec/dsp/dsp_arm_v6.S1
-rw-r--r--lib/unwarminder/safe_read.S2
-rwxr-xr-xtools/configure6
17 files changed, 43 insertions, 3 deletions
diff --git a/apps/plugins/mpegplayer/libmpeg2/idct_arm.S b/apps/plugins/mpegplayer/libmpeg2/idct_arm.S
index 90eb5031c7..8ff7c90629 100644
--- a/apps/plugins/mpegplayer/libmpeg2/idct_arm.S
+++ b/apps/plugins/mpegplayer/libmpeg2/idct_arm.S
@@ -21,6 +21,8 @@
21 21
22#include "config.h" 22#include "config.h"
23 23
24 .syntax unified
25
24 .global mpeg2_idct_copy 26 .global mpeg2_idct_copy
25 .type mpeg2_idct_copy, %function 27 .type mpeg2_idct_copy, %function
26 .global mpeg2_idct_add 28 .global mpeg2_idct_add
diff --git a/apps/plugins/mpegplayer/libmpeg2/idct_armv6.S b/apps/plugins/mpegplayer/libmpeg2/idct_armv6.S
index a259721410..ad28cefcf2 100644
--- a/apps/plugins/mpegplayer/libmpeg2/idct_armv6.S
+++ b/apps/plugins/mpegplayer/libmpeg2/idct_armv6.S
@@ -21,6 +21,8 @@
21 21
22#include "config.h" 22#include "config.h"
23 23
24 .syntax unified
25
24 .global mpeg2_idct_copy 26 .global mpeg2_idct_copy
25 .type mpeg2_idct_copy, %function 27 .type mpeg2_idct_copy, %function
26 .global mpeg2_idct_add 28 .global mpeg2_idct_add
diff --git a/apps/recorder/jpeg_idct_arm.S b/apps/recorder/jpeg_idct_arm.S
index 1f2603da1b..e706a17384 100644
--- a/apps/recorder/jpeg_idct_arm.S
+++ b/apps/recorder/jpeg_idct_arm.S
@@ -24,6 +24,8 @@
24#include "config.h" 24#include "config.h"
25#include "apps/core_asmdefs.h" 25#include "apps/core_asmdefs.h"
26 26
27 .syntax unified
28
27 .section .text 29 .section .text
28 .align 2 30 .align 2
29 .global jpeg_idct1h 31 .global jpeg_idct1h
diff --git a/firmware/asm/arm/lcd-as-memframe.S b/firmware/asm/arm/lcd-as-memframe.S
index d42b2a920d..f69f6e5080 100644
--- a/firmware/asm/arm/lcd-as-memframe.S
+++ b/firmware/asm/arm/lcd-as-memframe.S
@@ -24,6 +24,8 @@
24#include "config.h" 24#include "config.h"
25#include "cpu.h" 25#include "cpu.h"
26 26
27 .syntax unified
28
27/**************************************************************************** 29/****************************************************************************
28 * void lcd_copy_buffer_rect(fb_data *dst, fb_data *src, int width, 30 * void lcd_copy_buffer_rect(fb_data *dst, fb_data *src, int width,
29 * int height); 31 * int height);
diff --git a/firmware/asm/arm/memcpy.S b/firmware/asm/arm/memcpy.S
index 86fc6b7930..1fbb6660e9 100644
--- a/firmware/asm/arm/memcpy.S
+++ b/firmware/asm/arm/memcpy.S
@@ -35,6 +35,8 @@
35#define push lsr 35#define push lsr
36#endif 36#endif
37 37
38 .syntax unified
39
38/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ 40/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
39/* Prototype: void *mempcpy(void *dest, const void *src, size_t n); */ 41/* Prototype: void *mempcpy(void *dest, const void *src, size_t n); */
40 42
diff --git a/firmware/asm/arm/memmove.S b/firmware/asm/arm/memmove.S
index e5c9b42928..cf22a74622 100644
--- a/firmware/asm/arm/memmove.S
+++ b/firmware/asm/arm/memmove.S
@@ -35,6 +35,8 @@
35#define push lsr 35#define push lsr
36#endif 36#endif
37 37
38 .syntax unified
39
38 .text 40 .text
39 41
40/* 42/*
diff --git a/firmware/asm/arm/memset.S b/firmware/asm/arm/memset.S
index d727f2a5ec..ef5cdb5819 100644
--- a/firmware/asm/arm/memset.S
+++ b/firmware/asm/arm/memset.S
@@ -20,6 +20,8 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22 22
23 .syntax unified
24
23 .section .icode,"ax",%progbits 25 .section .icode,"ax",%progbits
24 26
25 .align 2 27 .align 2
diff --git a/firmware/asm/arm/memset16.S b/firmware/asm/arm/memset16.S
index 226eac39e1..851b9207a2 100644
--- a/firmware/asm/arm/memset16.S
+++ b/firmware/asm/arm/memset16.S
@@ -20,6 +20,8 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22 22
23 .syntax unified
24
23 .section .icode,"ax",%progbits 25 .section .icode,"ax",%progbits
24 26
25 .align 2 27 .align 2
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 */
1018 * These macros are for switching on unified syntax in inline assembly. 1018 * These macros are for switching on unified syntax in inline assembly.
1019 * Older versions of GCC emit assembly in divided syntax with no option 1019 * Older versions of GCC emit assembly in divided syntax with no option
1020 * to enable unified syntax. 1020 * to enable unified syntax.
1021 *
1022 * FIXME: This needs to be looked at after the toolchain bump
1023 */ 1021 */
1022#if (__GNUC__ < 8)
1024#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n" 1023#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n"
1025#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n" 1024#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n"
1025#else
1026#define BEGIN_ARM_ASM_SYNTAX_UNIFIED
1027#define END_ARM_ASM_SYNTAX_UNIFIED
1028#endif
1026 1029
1027#if defined(CPU_ARM) && defined(__ASSEMBLER__) 1030#if defined(CPU_ARM) && defined(__ASSEMBLER__)
1031#if (__GNUC__ < 8)
1028.syntax unified 1032.syntax unified
1033#endif
1029/* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */ 1034/* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */
1030.macro ldmpc cond="", order="ia", regs 1035.macro ldmpc cond="", order="ia", regs
1031#if ARM_ARCH == 4 && defined(USE_THUMB) 1036#if ARM_ARCH == 4 && defined(USE_THUMB)
@@ -1043,6 +1048,9 @@ Lyre prototype 1 */
1043 ldr\cond pc, [sp], #4 1048 ldr\cond pc, [sp], #4
1044#endif 1049#endif
1045.endm 1050.endm
1051#if (__GNUC__ < 8)
1052.syntax divided
1053#endif
1046#endif 1054#endif
1047 1055
1048#if defined(CPU_COLDFIRE) && defined(__ASSEMBLER__) 1056#if defined(CPU_COLDFIRE) && defined(__ASSEMBLER__)
diff --git a/firmware/target/arm/ata-as-arm.S b/firmware/target/arm/ata-as-arm.S
index 16c2928bf1..cec4a7e235 100644
--- a/firmware/target/arm/ata-as-arm.S
+++ b/firmware/target/arm/ata-as-arm.S
@@ -21,6 +21,7 @@
21 21
22#include "config.h" 22#include "config.h"
23 23
24 .syntax unified
24 25
25#if CONFIG_CPU == PP5002 26#if CONFIG_CPU == PP5002
26 /* Causes ATA retries on iPod G3 probably related to improper controller 27 /* Causes ATA retries on iPod G3 probably related to improper controller
diff --git a/lib/arm_support/support-arm.S b/lib/arm_support/support-arm.S
index 3af0c70975..d12392eeb3 100644
--- a/lib/arm_support/support-arm.S
+++ b/lib/arm_support/support-arm.S
@@ -30,6 +30,8 @@
30 30
31#include <config.h> 31#include <config.h>
32 32
33.syntax unified
34
33.macro ARM_SDIV32_PRE numerator, divisor, sign 35.macro ARM_SDIV32_PRE numerator, divisor, sign
34 /* sign[31] = divisor sign */ 36 /* sign[31] = divisor sign */
35 ands \sign, \divisor, #1<<31 37 ands \sign, \divisor, #1<<31
diff --git a/lib/rbcodec/codecs/demac/libdemac/udiv32_arm.S b/lib/rbcodec/codecs/demac/libdemac/udiv32_arm.S
index 1d19160a91..514bae2949 100644
--- a/lib/rbcodec/codecs/demac/libdemac/udiv32_arm.S
+++ b/lib/rbcodec/codecs/demac/libdemac/udiv32_arm.S
@@ -29,6 +29,9 @@
29 ****************************************************************************/ 29 ****************************************************************************/
30 30
31#include "config.h" 31#include "config.h"
32
33.syntax unified
34
32/* On targets with codec iram, a header file will be generated after an initial 35/* On targets with codec iram, a header file will be generated after an initial
33 link of the APE codec, stating the amount of IRAM remaining for use by the 36 link of the APE codec, stating the amount of IRAM remaining for use by the
34 reciprocal lookup table. */ 37 reciprocal lookup table. */
diff --git a/lib/rbcodec/codecs/libtta/filter_arm.S b/lib/rbcodec/codecs/libtta/filter_arm.S
index 10f1491796..d801a52419 100644
--- a/lib/rbcodec/codecs/libtta/filter_arm.S
+++ b/lib/rbcodec/codecs/libtta/filter_arm.S
@@ -26,6 +26,8 @@
26 * void hybrid_filter(fltst *fs, int *in) 26 * void hybrid_filter(fltst *fs, int *in)
27 */ 27 */
28 28
29 .syntax unified
30
29#ifdef USE_IRAM 31#ifdef USE_IRAM
30 .section .icode, "ax", %progbits 32 .section .icode, "ax", %progbits
31#else 33#else
diff --git a/lib/rbcodec/dsp/dsp_arm.S b/lib/rbcodec/dsp/dsp_arm.S
index 864abee4b6..b17c94fe6c 100644
--- a/lib/rbcodec/dsp/dsp_arm.S
+++ b/lib/rbcodec/dsp/dsp_arm.S
@@ -22,6 +22,7 @@
22 ****************************************************************************/ 22 ****************************************************************************/
23 #include "rbcodecconfig.h" 23 #include "rbcodecconfig.h"
24 24
25 .syntax unified
25/**************************************************************************** 26/****************************************************************************
26 * void channel_mode_proc_mono(struct dsp_proc_entry *this, 27 * void channel_mode_proc_mono(struct dsp_proc_entry *this,
27 * struct dsp_buffer **buf_p) 28 * struct dsp_buffer **buf_p)
diff --git a/lib/rbcodec/dsp/dsp_arm_v6.S b/lib/rbcodec/dsp/dsp_arm_v6.S
index aa27ec90f6..facd3facbd 100644
--- a/lib/rbcodec/dsp/dsp_arm_v6.S
+++ b/lib/rbcodec/dsp/dsp_arm_v6.S
@@ -20,6 +20,7 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 #include "rbcodecconfig.h" 21 #include "rbcodecconfig.h"
22 22
23 .syntax unified
23/**************************************************************************** 24/****************************************************************************
24 * void sample_output_mono(struct sample_io_data *this, 25 * void sample_output_mono(struct sample_io_data *this,
25 * struct dsp_buffer *src, 26 * struct dsp_buffer *src,
diff --git a/lib/unwarminder/safe_read.S b/lib/unwarminder/safe_read.S
index ce4913870c..557f3dca31 100644
--- a/lib/unwarminder/safe_read.S
+++ b/lib/unwarminder/safe_read.S
@@ -20,6 +20,8 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22 22
23.syntax unified
24
23.data 25.data
24was_aborted: 26was_aborted:
25 .word 0 27 .word 0
diff --git a/tools/configure b/tools/configure
index 8a2e499a29..be4b0e3902 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4533,7 +4533,11 @@ if [ -z "$arch" ]; then
4533 elif [ -n "$(echo $cpp_defines | grep -w __arm__)" ]; then 4533 elif [ -n "$(echo $cpp_defines | grep -w __arm__)" ]; then
4534 arch="arm" 4534 arch="arm"
4535 # cpp defines like "#define __ARM_ARCH_4TE__ 1" (where we want to extract the 4) 4535 # cpp defines like "#define __ARM_ARCH_4TE__ 1" (where we want to extract the 4)
4536 arch_version="$(echo $cpp_defines | tr ' ' '\012' | grep __ARM_ARCH | sed -e 's,.*\([0-9]\).*,\1,' | grep -v __ARM_ARCH)" 4536 arch_version="$(echo $cpp_defines | tr ' ' '\012' | grep __ARM_ARCH | sed -e 's,.*\([0-9]\).*,\1,' | grep -v __ARM_ARCH | head -1)"
4537 if test "$gccnum" -ge "800"; then
4538 # GCC8+ can natively emit unified asm syntax
4539 GCCOPTS="$GCCOPTS -masm-syntax-unified"
4540 fi
4537 elif [ -n "$(echo $cpp_defines | grep -w __mips__)" ]; then 4541 elif [ -n "$(echo $cpp_defines | grep -w __mips__)" ]; then
4538 arch="mips" 4542 arch="mips"
4539 arch_version="$(echo $cpp_defines | tr ' ' '\012' | grep _MIPS_ARCH_MIPS | sed -e 's,.*\([0-9][0-9]\).*,\1,' | grep -v _MIPS_ARCH_MIPS)" 4543 arch_version="$(echo $cpp_defines | tr ' ' '\012' | grep _MIPS_ARCH_MIPS | sed -e 's,.*\([0-9][0-9]\).*,\1,' | grep -v _MIPS_ARCH_MIPS)"