1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/arm.
4 # We check to see if the compiler and flags are
5 # selecting the hard-float ABI and if they are then
6 # we set libc_cv_arm_pcs_vfp to yes which causes
7 # HAVE_ARM_PCS_VFP to be defined in config.h and
8 # in include/libc-symbols.h and thus available to
9 # shlib-versions to select the appropriate name for
10 # the dynamic linker via %ifdef.
11 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
12 [libc_cv_arm_pcs_vfp],
13 [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
16 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
17 if test $libc_cv_arm_pcs_vfp = yes; then
18 AC_DEFINE(HAVE_ARM_PCS_VFP)
19 LIBC_CONFIG_VAR([default-abi], [hard])
21 LIBC_CONFIG_VAR([default-abi], [soft])
24 AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
25 libc_cv_arm_pcrel_movw, [
26 cat > conftest.s <<\EOF
34 foo: movw r0, #:lower16:symbol - 1f - 8
35 movt r0, #:upper16:symbol - 1f - 8
37 @ And now a case with a local symbol.
38 movw r0, #:lower16:3f - 2f - 8
39 movt r0, #:upper16:3f - 2f - 8
49 libc_cv_arm_pcrel_movw=no
50 ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
51 -nostartfiles -nostdlib -shared \
52 -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
53 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
55 cat conftest.dr 1>&AS_MESSAGE_LOG_FD
57 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
60 if test $libc_cv_arm_pcrel_movw = yes; then
61 AC_DEFINE([ARM_PCREL_MOVW_OK])
64 # This was buggy in assemblers from GNU binutils versions before 2.25.1
65 # (it's known to be broken in 2.24 and 2.25; see
66 # https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
67 AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly],
68 libc_cv_arm_tpoff_addend, [
69 cat > conftest.s <<\EOF
78 .section .tdata,"awT",%progbits
83 libc_cv_arm_tpoff_addend=no
84 ${CC-cc} -c $CFLAGS $CPPFLAGS \
85 -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
86 LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD &&
88 cat conftest.x 1>&AS_MESSAGE_LOG_FD
89 $AWK 'BEGIN { result = 2 }
90 $1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ {
91 # Check for little-endian or big-endian encoding of 4 in the in-place addend.
92 result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
95 ' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes
98 if test $libc_cv_arm_tpoff_addend = no; then
99 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes])
100 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes])
104 libc_cv_gcc_unwind_find_fde=no
106 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
107 CFLAGS=${CFLAGS% -fno-unwind-tables}