1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/arm.
4 dnl It is always possible to access static and hidden symbols in an
5 dnl position independent way. This has been true since GCC 4.1,
6 dnl which is older than the minimum version required to build libc.
7 AC_DEFINE(PI_STATIC_AND_HIDDEN)
9 # We check to see if the compiler and flags are
10 # selecting the hard-float ABI and if they are then
11 # we set libc_cv_arm_pcs_vfp to yes which causes
12 # HAVE_ARM_PCS_VFP to be defined in config.h and
13 # in include/libc-symbols.h and thus available to
14 # shlib-versions to select the appropriate name for
15 # the dynamic linker via %ifdef.
16 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
17 [libc_cv_arm_pcs_vfp],
18 [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
21 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
22 if test $libc_cv_arm_pcs_vfp = yes; then
23 AC_DEFINE(HAVE_ARM_PCS_VFP)
24 LIBC_CONFIG_VAR([default-abi], [hard])
26 LIBC_CONFIG_VAR([default-abi], [soft])
29 AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
30 libc_cv_arm_pcrel_movw, [
31 cat > conftest.s <<\EOF
39 foo: movw r0, #:lower16:symbol - 1f - 8
40 movt r0, #:upper16:symbol - 1f - 8
42 @ And now a case with a local symbol.
43 movw r0, #:lower16:3f - 2f - 8
44 movt r0, #:upper16:3f - 2f - 8
54 libc_cv_arm_pcrel_movw=no
55 ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
56 -nostartfiles -nostdlib -shared \
57 -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
58 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
60 cat conftest.dr 1>&AS_MESSAGE_LOG_FD
62 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
65 if test $libc_cv_arm_pcrel_movw = yes; then
66 AC_DEFINE([ARM_PCREL_MOVW_OK])
69 # This was buggy in assemblers from GNU binutils versions before 2.25.1
70 # (it's known to be broken in 2.24 and 2.25; see
71 # https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
72 AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly],
73 libc_cv_arm_tpoff_addend, [
74 cat > conftest.s <<\EOF
83 .section .tdata,"awT",%progbits
88 libc_cv_arm_tpoff_addend=no
89 ${CC-cc} -c $CFLAGS $CPPFLAGS \
90 -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
91 LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD &&
93 cat conftest.x 1>&AS_MESSAGE_LOG_FD
94 $AWK 'BEGIN { result = 2 }
95 $1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ {
96 # Check for little-endian or big-endian encoding of 4 in the in-place addend.
97 result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
100 ' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes
103 if test $libc_cv_arm_tpoff_addend = no; then
104 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes])
105 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes])
109 libc_cv_gcc_unwind_find_fde=no
111 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
112 CFLAGS=${CFLAGS% -fno-unwind-tables}