public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: <libc-alpha@sourceware.org>
Subject: [COMMITTED] aarch64: More configure checks for libmvec
Date: Fri, 5 May 2023 11:53:37 +0100	[thread overview]
Message-ID: <20230505105337.555134-1-szabolcs.nagy@arm.com> (raw)

Check assembler and linker support too, not just SVE ACLE in the
compiler, since variant PCS requires at least binutils 2.32.1.
---
 sysdeps/aarch64/configure    | 29 ++++++++++++++++++++++++++---
 sysdeps/aarch64/configure.ac | 25 ++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
index 030996c55a..5497dd397e 100644
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -332,7 +332,7 @@ if test x"$build_mathvec" = xnotset; then
   build_mathvec=yes
 fi
 
-# Check if compiler is sufficient to build mathvec (needs SVE ACLE)
+# Check if compiler supports 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_aarch64_sve_acle+:} false; then :
@@ -355,6 +355,29 @@ EOF
 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
+
+# Check if compiler is sufficient to build mathvec
+if test $build_mathvec = yes; then
+  fail=no
+  if test $libc_cv_aarch64_variant_pcs = no; then
+    fail=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but linker does not support variant PCS." >&5
+$as_echo "$as_me: WARNING: mathvec is enabled but linker does not support variant PCS." >&2;}
+  fi
+  if test $libc_cv_aarch64_sve_asm = no; then
+    fail=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but assembler does not support SVE." >&5
+$as_echo "$as_me: WARNING: mathvec is enabled but assembler does not support SVE." >&2;}
+  fi
+  if test $libc_cv_aarch64_sve_acle = no; then
+    fail=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but compiler does not have SVE ACLE." >&5
+$as_echo "$as_me: WARNING: mathvec is enabled but compiler does not have SVE ACLE." >&2;}
+  fi
+  if test $fail = yes; then
+    as_fn_error $? "use a compatible toolchain or configure with --disable-mathvec (this results in incomplete ABI)." "$LINENO" 5
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is disabled, this results in incomplete ABI." >&5
+$as_echo "$as_me: WARNING: mathvec is disabled, this results in incomplete ABI." >&2;}
 fi
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 76f78fcba9..27874eceb4 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -106,7 +106,7 @@ if test x"$build_mathvec" = xnotset; then
   build_mathvec=yes
 fi
 
-# Check if compiler is sufficient to build mathvec (needs SVE ACLE)
+# Check if compiler supports SVE ACLE.
 AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_aarch64_sve_acle, [dnl
   cat > conftest.c <<EOF
 #include <arm_sve.h>
@@ -117,6 +117,25 @@ EOF
     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).])
+
+# Check if compiler is sufficient to build mathvec
+if test $build_mathvec = yes; then
+  fail=no
+  if test $libc_cv_aarch64_variant_pcs = no; then
+    fail=yes
+    AC_MSG_WARN([mathvec is enabled but linker does not support variant PCS.])
+  fi
+  if test $libc_cv_aarch64_sve_asm = no; then
+    fail=yes
+    AC_MSG_WARN([mathvec is enabled but assembler does not support SVE.])
+  fi
+  if test $libc_cv_aarch64_sve_acle = no; then
+    fail=yes
+    AC_MSG_WARN([mathvec is enabled but compiler does not have SVE ACLE.])
+  fi
+  if test $fail = yes; then
+    AC_MSG_ERROR([use a compatible toolchain or configure with --disable-mathvec (this results in incomplete ABI).])
+  fi
+else
+  AC_MSG_WARN([mathvec is disabled, this results in incomplete ABI.])
 fi
-- 
2.25.1


                 reply	other threads:[~2023-05-05 10:53 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=20230505105337.555134-1-szabolcs.nagy@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=libc-alpha@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: link
Be 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).