Skip to contentSkip to conversation

package/audit: force arm mode instead of Thumb mode

PATCH Superseded Fabrice Fontaine 1 participant 1 message Feb 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/audit: force arm mode instead of Thumb mode

Fix the following build failure:

/tmp/ccY5gl3z.s:2145: Error: selected processor does not support `mcr p15,0,r2,c7,c10,5' in Thumb mode

Fixes:
- http://autobuild.buildroot.org/results/9d18a0d360b2e2f9e87c55daedda62d6ce198bb9

---
Changes v1 -> v2 (after review of Yann E. Morin):
- Update BR2_PACKAGE_AUDIT_ARCH_SUPPORTS

 package/audit/Config.in | 8 +++++---
 package/audit/audit.mk  | 7 +++++++
 2 files changed, 12 insertions(+), 3 deletions(-)
package/audit/Config.in +5 -3
index 6e5761533f..89341dfe31 100644
@@ -1,9 +1,11 @@
 # audit has some builtin per-architecture system call tables
 config BR2_PACKAGE_AUDIT_ARCH_SUPPORTS
 	bool
-	default y if BR2_aarch64 || BR2_arm || BR2_armeb || \
-		BR2_i386 || BR2_powerpc || BR2_powerpc64 || \
-		BR2_x86_64
+	default y if BR2_aarch64
+	default y if (BR2_arm || BR2_armeb) && \
+		(BR2_ARM_CPU_HAS_ARM || BR2_ARM_CPU_HAS_THUMB2)
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_powerpc || BR2_powerpc64
 
 config BR2_PACKAGE_AUDIT
 	bool "audit"
package/audit/audit.mk +7 -0
index cbb174b980..af81dabac0 100644
@@ -15,6 +15,13 @@ AUDIT_INSTALL_STAGING = YES
 
 AUDIT_CONF_OPTS = --without-python --without-python3
 
+# src/libev has some assembly function that is not present in Thumb mode:
+# Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode
+# so, we desactivate Thumb mode
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+AUDIT_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
+endif
+
 ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
 AUDIT_DEPENDENCIES += libcap-ng
 AUDIT_CONF_OPTS += --with-libcap-ng=yes
Signature · 6 lines
2.39.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot