ARM: Use '.object_arch' directive in NEON assembly file
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>
Mon, 22 Mar 2010 09:54:51 +0000 (11:54 +0200)
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>
Mon, 22 Mar 2010 10:12:03 +0000 (12:12 +0200)
This can be used to override the architecture recorded in the EABI object
attribute section. We set a minimum arch to 'armv4'. Binutils documentation
recommends to use this directive with the code performing runtime detection
of CPU features.

Additionally NEON/VFP EABI attributes are suppressed. And the instruction
set to use is explicitly set to '.arm'.

Configure test for NEON support is also updated to include a bunch of
these new directives (if any of these is unsupported by the assembler,
it is better to fail configure test than to fail library build).

All these changes are required to fix SIGILL problem on armv4t, reported in
http://lists.freedesktop.org/archives/pixman/2010-March/000123.html

configure.ac
pixman/pixman-arm-neon-asm.S

index fc3ee24..4668715 100644 (file)
@@ -415,10 +415,14 @@ dnl Check if assembler is gas compatible and supports NEON instructions
 have_arm_neon=no
 AC_MSG_CHECKING(whether to use ARM NEON assembler)
 xserver_save_CFLAGS=$CFLAGS
-CFLAGS="-x assembler-with-cpp"
+CFLAGS="-x assembler-with-cpp $CFLAGS"
 AC_COMPILE_IFELSE([[
 .text
 .fpu neon
+.arch armv7a
+.object_arch armv4
+.eabi_attribute 10, 0
+.arm
 .altmacro
 #ifndef __ARM_EABI__
 #error EABI is required (to be sure that calling conventions are compatible)
index eb8cc4c..6be8d23 100644 (file)
     .text
     .fpu neon
     .arch armv7a
+    .object_arch armv4
+    .eabi_attribute 10, 0 /* suppress Tag_FP_arch */
+    .eabi_attribute 12, 0 /* suppress Tag_Advanced_SIMD_arch */
+    .arm
     .altmacro
 
 #include "pixman-arm-neon-asm.h"