]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: fix check for SVE support in assembler
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 13 Mar 2024 14:34:14 +0000 (14:34 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 8 Apr 2024 15:53:05 +0000 (16:53 +0100)
Due to GCC bug 110901 -mcpu can override -march setting when compiling
asm code and thus a compiler targetting a specific cpu can fail the
configure check even when binutils gas supports SVE.

The workaround is that explicit .arch directive overrides both -mcpu
and -march, and since that's what the actual SVE memcpy uses the
configure check should use that too even if the GCC issue is fixed
independently.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 73c26018ed0ecd9c807bb363cc2c2ab4aca66a82)

sysdeps/aarch64/configure [changed mode: 0644->0755]
sysdeps/aarch64/configure.ac

old mode 100644 (file)
new mode 100755 (executable)
index 2130f6b..19d2b46
@@ -307,9 +307,10 @@ if ${libc_cv_aarch64_sve_asm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.s <<\EOF
-        ptrue p0.b
+       .arch armv8.2-a+sve
+       ptrue p0.b
 EOF
-if { ac_try='${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&5'
+if { ac_try='${CC-cc} -c conftest.s 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
index 85c6f765082811f5e8312eebda8d615eabcf39a1..bb5adb17828c0d8f203478c7872fd4fbc84f265a 100644 (file)
@@ -90,9 +90,10 @@ LIBC_CONFIG_VAR([aarch64-variant-pcs], [$libc_cv_aarch64_variant_pcs])
 # Check if asm support armv8.2-a+sve
 AC_CACHE_CHECK([for SVE support in assembler], [libc_cv_aarch64_sve_asm], [dnl
 cat > conftest.s <<\EOF
-        ptrue p0.b
+       .arch armv8.2-a+sve
+       ptrue p0.b
 EOF
-if AC_TRY_COMMAND(${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&AS_MESSAGE_LOG_FD); then
+if AC_TRY_COMMAND(${CC-cc} -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
   libc_cv_aarch64_sve_asm=yes
 else
   libc_cv_aarch64_sve_asm=no