aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/aarch64/configure.ac
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2020-10-26 15:48:01 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2020-11-02 09:39:24 +0000
commite156dabc766d6f6f99ce9402999eae380a3ec1f2 (patch)
treee57a3b9d8c12c24d04ee4507571fa967683cff7a /sysdeps/aarch64/configure.ac
parent558251bd8785760ad40fcbfeaaee5d27fa5b0fe4 (diff)
downloadglibc-e156dabc766d6f6f99ce9402999eae380a3ec1f2.tar
glibc-e156dabc766d6f6f99ce9402999eae380a3ec1f2.tar.gz
glibc-e156dabc766d6f6f99ce9402999eae380a3ec1f2.tar.bz2
glibc-e156dabc766d6f6f99ce9402999eae380a3ec1f2.zip
aarch64: Add variant PCS lazy binding test [BZ #26798]
This test fails without bug 26798 fixed because some integer registers likely get clobbered by lazy binding and variant PCS only allows x16 and x17 to be clobbered at call time. The test requires binutils 2.32.1 or newer for handling variant PCS symbols. SVE registers are not covered by this test, to avoid the complexity of handling multiple compile- and runtime feature support cases.
Diffstat (limited to 'sysdeps/aarch64/configure.ac')
-rw-r--r--sysdeps/aarch64/configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 8b042d6d05..da2a8d81d0 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -61,3 +61,25 @@ EOF
if test $libc_cv_aarch64_pac_ret = yes; then
AC_DEFINE(HAVE_AARCH64_PAC_RET)
fi
+
+# Check if binutils supports variant PCS symbols.
+AC_CACHE_CHECK([for variant PCS support], [libc_cv_aarch64_variant_pcs], [dnl
+ cat > conftest.S <<EOF
+.global foo
+.type foo, %function
+.variant_pcs foo
+foo:
+ ret
+.global bar
+.type bar, %function
+bar:
+ b foo
+EOF
+ libc_cv_aarch64_variant_pcs=no
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o conftest.so conftest.S]) \
+ && AC_TRY_COMMAND([$READELF -dW conftest.so | grep -q AARCH64_VARIANT_PCS])
+ then
+ libc_cv_aarch64_variant_pcs=yes
+ fi
+ rm -rf conftest.*])
+LIBC_CONFIG_VAR([aarch64-variant-pcs], [$libc_cv_aarch64_variant_pcs])