From fa164f89e012fb95e7eacd042e62b15bb9c9ced2 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 3 Dec 2025 22:49:25 -0500 Subject: [PATCH] tools: Detect A-profile ARM cores for hosted and sim builds The only v7-a targets we have are built using the androidndk (with gcc 4.9) but it is possible to perform "self-hosted" builds for eg the simulator or the sdlapp. Where this gets messy is the considerable amount of inline arm asm we have. Native builds will need considerably more work to support v7-a processors, but we have to start somewhere. (Note that this contains parts of commit 508bfabe8, which had to be reverted due to breakage) Change-Id: Ia1c8e10d21a976c68fdaae58e4d776854b63186c --- firmware/export/config.h | 9 +++++++-- tools/configure | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/firmware/export/config.h b/firmware/export/config.h index eb976c9fd4..168334228a 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -720,8 +720,13 @@ Lyre prototype 1 */ # endif # elif ARM_PROFILE == ARM_PROFILE_CLASSIC # define CPU_ARM_CLASSIC +# elif ARM_PROFILE == ARM_PROFILE_APPLICATION +# define CPU_ARM_APPLICATION +# if defined(__ARM_FEATURE_IDIV) // Some v7-a, all v8-a +# define ARM_HAVE_HW_DIV +# endif # endif -# if (CONFIG_PLATFORM & PLATFORM_NATIVE) +# if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(ARM_HAVE_HW_DIV) # define ARM_NEED_DIV0 # endif #endif @@ -1100,7 +1105,7 @@ Lyre prototype 1 */ * Older versions of GCC emit assembly in divided syntax with no option * to enable unified syntax. */ -#if (__GNUC__ < 8) && defined(CPU_ARM_CLASSIC) || defined(CTRU) +#if (__GNUC__ < 8) && (defined(CPU_ARM_CLASSIC)||defined(CPU_ARM_APPLICATION)) #define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n" #define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n" #else diff --git a/tools/configure b/tools/configure index 6461825cc7..43356cfd93 100755 --- a/tools/configure +++ b/tools/configure @@ -4735,7 +4735,10 @@ if [ -z "$arch" ]; then GCCOPTS="$GCCOPTS -masm-syntax-unified" fi case "$arch_profile" in - 77) + 65) # Cortex-A + arch_profile=application + ;; + 77) # Cortex-M arch_profile=micro # We have a lot of assembly written for ARM32, which won't @@ -4857,6 +4860,7 @@ cat > autoconf.h.new <