public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] aarch64: SVE ACLE configure test cleanups Date: Fri, 5 May 2023 09:28:45 +0000 (GMT) [thread overview] Message-ID: <20230505092845.393AF3856DC2@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ee68e9cba456ed02f080cccd0c37af671bd48108 commit ee68e9cba456ed02f080cccd0c37af671bd48108 Author: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Thu May 4 10:14:43 2023 +0100 aarch64: SVE ACLE configure test cleanups Use more idiomatic configure test for better autoconf cache and logs. Diff: --- sysdeps/aarch64/configure | 24 ++++++++++++++++-------- sysdeps/aarch64/configure.ac | 19 +++++++++++-------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure index d0d78d69f1..030996c55a 100644 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -335,18 +335,26 @@ fi # Check if compiler is sufficient to build mathvec (needs SVE ACLE) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for availability of SVE ACLE" >&5 $as_echo_n "checking for availability of SVE ACLE... " >&6; } -if ${libc_cv_has_sve_acle+:} false; then : +if ${libc_cv_aarch64_sve_acle+:} false; then : $as_echo_n "(cached) " >&6 else - if test $build_mathvec = yes; then cat > conftest.c <<EOF #include <arm_sve.h> EOF - if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then - as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)." - fi - rm conftest.c + if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + libc_cv_aarch64_sve_acle=yes + else + libc_cv_aarch64_sve_acle=no fi + rm conftest.c +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_sve_acle" >&5 +$as_echo "$libc_cv_aarch64_sve_acle" >&6; } +if test $build_mathvec = yes && test $libc_cv_aarch64_sve_acle = no; then + as_fn_error $? "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_has_sve_acle" >&5 -$as_echo "$libc_cv_has_sve_acle" >&6; } diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 259edc3de8..76f78fcba9 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -107,13 +107,16 @@ if test x"$build_mathvec" = xnotset; then fi # Check if compiler is sufficient to build mathvec (needs SVE ACLE) -AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_has_sve_acle, [dnl - if test $build_mathvec = yes; then - cat > conftest.c <<EOF +AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_aarch64_sve_acle, [dnl + cat > conftest.c <<EOF #include <arm_sve.h> EOF - if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then - as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)." - fi - rm conftest.c - fi]) + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c]); then + libc_cv_aarch64_sve_acle=yes + else + libc_cv_aarch64_sve_acle=no + fi + rm conftest.c]) +if test $build_mathvec = yes && test $libc_cv_aarch64_sve_acle = no; then + AC_MSG_ERROR([mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI).]) +fi
reply other threads:[~2023-05-05 9:28 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230505092845.393AF3856DC2@sourceware.org \ --to=nsz@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).