118 lines
3.3 KiB
Diff
118 lines
3.3 KiB
Diff
From e0da78a258a34c26488b7ae623f9ae8727c2b264 Mon Sep 17 00:00:00 2001
|
|
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
|
|
Date: Mon, 14 Nov 2022 17:14:18 +0000
|
|
Subject: [PATCH 117/157] [Backport][SME] libgcc: aarch64: Configure check for
|
|
.variant_pcs support
|
|
|
|
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3ebb591c65b4fbe0cddd23ebc0ca2d9f7aef2cec
|
|
|
|
Ideally SME support routines in libgcc are marked as variant PCS symbols
|
|
so check if as supports the directive.
|
|
|
|
libgcc/ChangeLog:
|
|
|
|
* config.in: Undef HAVE_AS_VARIANT_PCS.
|
|
* configure: Regenerate.
|
|
* configure.ac: Check for .variant_pcs.
|
|
---
|
|
libgcc/config.in | 3 +++
|
|
libgcc/configure | 39 +++++++++++++++++++++++++++++++++++++++
|
|
libgcc/configure.ac | 17 +++++++++++++++++
|
|
3 files changed, 59 insertions(+)
|
|
|
|
diff --git a/libgcc/config.in b/libgcc/config.in
|
|
index f93c64a00..5dd96cdf6 100644
|
|
--- a/libgcc/config.in
|
|
+++ b/libgcc/config.in
|
|
@@ -13,6 +13,9 @@
|
|
/* Define to 1 if the assembler supports LSE. */
|
|
#undef HAVE_AS_LSE
|
|
|
|
+/* Define to 1 if the assembler supports .variant_pcs. */
|
|
+#undef HAVE_AS_VARIANT_PCS
|
|
+
|
|
/* Define to 1 if the target assembler supports thread-local storage. */
|
|
#undef HAVE_CC_TLS
|
|
|
|
diff --git a/libgcc/configure b/libgcc/configure
|
|
index 1f9b2ac57..afe02b303 100755
|
|
--- a/libgcc/configure
|
|
+++ b/libgcc/configure
|
|
@@ -5619,6 +5619,45 @@ $as_echo "#define HAVE_AS_LSE 1" >>confdefs.h
|
|
;;
|
|
esac
|
|
|
|
+
|
|
+
|
|
+case "${target}" in
|
|
+aarch64*-*-*)
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if as supports .variant_pcs" >&5
|
|
+$as_echo_n "checking if as supports .variant_pcs... " >&6; }
|
|
+if ${libgcc_cv_as_variant_pcs+:} false; then :
|
|
+ $as_echo_n "(cached) " >&6
|
|
+else
|
|
+
|
|
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
+/* end confdefs.h. */
|
|
+
|
|
+int
|
|
+main ()
|
|
+{
|
|
+asm (".variant_pcs foobar");
|
|
+ ;
|
|
+ return 0;
|
|
+}
|
|
+_ACEOF
|
|
+if ac_fn_c_try_compile "$LINENO"; then :
|
|
+ libgcc_cv_as_variant_pcs=yes
|
|
+else
|
|
+ libgcc_cv_as_variant_pcs=no
|
|
+fi
|
|
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
+
|
|
+fi
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_as_variant_pcs" >&5
|
|
+$as_echo "$libgcc_cv_as_variant_pcs" >&6; }
|
|
+ if test x$libgcc_cv_as_variant_pcs = xyes; then
|
|
+
|
|
+$as_echo "#define HAVE_AS_VARIANT_PCS 1" >>confdefs.h
|
|
+
|
|
+ fi
|
|
+ ;;
|
|
+esac
|
|
+
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for init priority support" >&5
|
|
$as_echo_n "checking for init priority support... " >&6; }
|
|
if ${libgcc_cv_init_priority+:} false; then :
|
|
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
|
|
index 2fc9d5d7c..abc398c91 100644
|
|
--- a/libgcc/configure.ac
|
|
+++ b/libgcc/configure.ac
|
|
@@ -648,6 +648,23 @@ changequote([,])dnl
|
|
esac])
|
|
LIBGCC_CHECK_AS_LSE
|
|
|
|
+dnl Check if as supports .variant_pcs.
|
|
+AC_DEFUN([LIBGCC_CHECK_AS_VARIANT_PCS], [
|
|
+case "${target}" in
|
|
+aarch64*-*-*)
|
|
+ AC_CACHE_CHECK([if as supports .variant_pcs], libgcc_cv_as_variant_pcs, [
|
|
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
|
|
+ [[asm (".variant_pcs foobar");]])],
|
|
+ [libgcc_cv_as_variant_pcs=yes], [libgcc_cv_as_variant_pcs=no])
|
|
+ ])
|
|
+ if test x$libgcc_cv_as_variant_pcs = xyes; then
|
|
+ AC_DEFINE(HAVE_AS_VARIANT_PCS, 1,
|
|
+ [Define to 1 if the assembler supports .variant_pcs.])
|
|
+ fi
|
|
+ ;;
|
|
+esac])
|
|
+LIBGCC_CHECK_AS_VARIANT_PCS
|
|
+
|
|
dnl Check if as supports RTM instructions.
|
|
AC_CACHE_CHECK(for init priority support, libgcc_cv_init_priority, [
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
|
|
--
|
|
2.33.0
|
|
|