about summary refs log tree commit diff
path: root/sysdeps/aarch64/configure.ac
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2024-03-13 14:34:14 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2024-04-10 14:03:08 +0100
commit1bf17ce978da71431dbd1fc3660cfae3dff0672f (patch)
treec329ee2bbf0c8acff6cb1f3186fa815cb62a7ddb /sysdeps/aarch64/configure.ac
parent168ae58e6e705a53a71850ee63ba5514fd5d7b70 (diff)
downloadglibc-1bf17ce978da71431dbd1fc3660cfae3dff0672f.tar.gz
glibc-1bf17ce978da71431dbd1fc3660cfae3dff0672f.tar.xz
glibc-1bf17ce978da71431dbd1fc3660cfae3dff0672f.zip
aarch64: fix check for SVE support in assembler
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)
Diffstat (limited to 'sysdeps/aarch64/configure.ac')
-rw-r--r--sysdeps/aarch64/configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 27874eceb4..56d12d661d 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -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