aboutsummaryrefslogtreecommitdiff
path: root/libgcc/configure.ac
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-15 11:01:19 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-15 11:01:19 +0200
commit5b2f76e36d861c881c6770b4f47c1fae6c0c8965 (patch)
tree563a3d7aff7d0c6e027f99e6502f92ff05b83257 /libgcc/configure.ac
parent2dc9294c3c7c81a6d5e1d4dedf58fea87bbadde6 (diff)
downloadgcc-5b2f76e36d861c881c6770b4f47c1fae6c0c8965.zip
gcc-5b2f76e36d861c881c6770b4f47c1fae6c0c8965.tar.gz
gcc-5b2f76e36d861c881c6770b4f47c1fae6c0c8965.tar.bz2
aarch64: Fix bootstrap with old binutils [PR93053]
As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build when using older binutils which lack LSE support, because those instructions are used in libgcc. Thanks to Kyrylo's hint, the following patches (hopefully) allow it to build even with older binutils by using .inst directive if LSE support isn't available in the assembler. 2020-04-15 Jakub Jelinek <jakub@redhat.com> PR target/93053 * configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking. * config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE is not defined, use just .arch armv8-a. (B, M, N, OPN): Define. (COMMENT): New .macro. (CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not defined. Otherwise, move the operands right after the glue? and comment out operands where the macros are used. * configure: Regenerated. * config.in: Regenerated.
Diffstat (limited to 'libgcc/configure.ac')
-rw-r--r--libgcc/configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 85979da9..bff6e54 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -599,6 +599,25 @@ i[[34567]]86-*-* | x86_64-*-*)
esac])
LIBGCC_CHECK_AS_AVX
+dnl Check if as supports LSE instructions.
+AC_DEFUN([LIBGCC_CHECK_AS_LSE], [
+case "${target}" in
+aarch64*-*-*)
+ AC_CACHE_CHECK([if the assembler supports LSE], libgcc_cv_as_lse, [
+ AC_TRY_COMPILE([],
+changequote(,)dnl
+ asm(".arch armv8-a+lse\n\tcas w0, w1, [x2]");
+changequote([,])dnl
+ ,
+ [libgcc_cv_as_lse=yes], [libgcc_cv_as_lse=no])
+ ])
+ if test x$libgcc_cv_as_lse = xyes; then
+ AC_DEFINE(HAVE_AS_LSE, 1, [Define to 1 if the assembler supports LSE.])
+ fi
+ ;;
+esac])
+LIBGCC_CHECK_AS_LSE
+
dnl Check if as supports RTM instructions.
AC_CACHE_CHECK(for init priority support, libgcc_cv_init_priority, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,