From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1895) id 8B9023858C39; Wed, 10 Apr 2024 14:11:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B9023858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712758285; bh=y6z8Es3VrJcOsv1oE5/5J8GtF2KRjw7Hb7KaLBATVNo=; h=From:To:Subject:Date:From; b=bbTe4EKqmrqlbPSG08MEI4RE8KRGRiMrptRBjdx2/Lv+qstDe7Ga9jJPXBIddMC9S F3a5gq0IiSkpSFwzhrl2g9IM9Vk+06x48JU63EG3MGNqO1kynjxv1ZEdjM0tRHiP7X vQKTsqUflC6VdWPncthHM9DtNLT5ozFK9G/f68Qw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Wilco Dijkstra To: glibc-cvs@sourceware.org Subject: [glibc/release/2.36/master] aarch64: fix check for SVE support in assembler X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/release/2.36/master X-Git-Oldrev: 88e96e7b5fc8c80ef22b08022dd327a546066aae X-Git-Newrev: b77e357bf9bf9972fc33bfbde4269d911eb9b682 Message-Id: <20240410141125.8B9023858C39@sourceware.org> Date: Wed, 10 Apr 2024 14:11:25 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b77e357bf9bf9972fc33bfbde4269d911eb9b682 commit b77e357bf9bf9972fc33bfbde4269d911eb9b682 Author: Szabolcs Nagy Date: Wed Mar 13 14:34:14 2024 +0000 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 (cherry picked from commit 73c26018ed0ecd9c807bb363cc2c2ab4aca66a82) Diff: --- sysdeps/aarch64/configure | 5 +++-- sysdeps/aarch64/configure.ac | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure old mode 100644 new mode 100755 index 2130f6b8f8..19d2b46cbf --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -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=$? diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 85c6f76508..bb5adb1782 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