]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/arm/configure.ac
Remove -fexceptions configure test.
[thirdparty/glibc.git] / sysdeps / arm / configure.ac
CommitLineData
01b32e73
TS
1GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2# Local configure fragment for sysdeps/arm.
3
9ec5b261 4dnl It is always possible to access static and hidden symbols in an
c25fec6f
RM
5dnl position independent way. This has been true since GCC 4.1,
6dnl which is older than the minimum version required to build libc.
7AC_DEFINE(PI_STATIC_AND_HIDDEN)
9ec5b261 8
d3b36017
CD
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.
16AC_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
8c2b1ed8
RM
19 yes
20 #endif
d3b36017
CD
21 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
22if test $libc_cv_arm_pcs_vfp = yes; then
23 AC_DEFINE(HAVE_ARM_PCS_VFP)
d56ca734 24 LIBC_CONFIG_VAR([default-abi], [hard])
a451ee33 25else
d56ca734 26 LIBC_CONFIG_VAR([default-abi], [soft])
d3b36017 27fi
90e5dd48
MR
28
29AC_CACHE_CHECK([whether the build tools support the GNU descriptor TLS scheme],
30 [libc_cv_arm_tls_desc],
31 [old_CFLAGS="$CFLAGS"
32 CFLAGS="$CFLAGS -mtls-dialect=gnu2"
33 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([asm (".word\tfoo(tlsdesc)");], [])],
34 [libc_cv_arm_tls_desc=yes], [libc_cv_arm_tls_desc=no])
35 CFLAGS="$old_CFLAGS"])
36if test $libc_cv_arm_tls_desc = yes; then
37 LIBC_CONFIG_VAR([have-arm-tls-desc], [yes])
38else
39 LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
40fi
37fccd41 41
8c2b1ed8
RM
42AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
43 libc_cv_arm_pcrel_movw, [
44cat > conftest.s <<\EOF
45 .syntax unified
46 .arm
47 .arch armv7-a
48
49 .text
50 .globl foo
51 .type foo,%function
52foo: movw r0, #:lower16:symbol - 1f - 8
53 movt r0, #:upper16:symbol - 1f - 8
541: add r0, pc
55 @ And now a case with a local symbol.
56 movw r0, #:lower16:3f - 2f - 8
57 movt r0, #:upper16:3f - 2f - 8
582: add r0, pc
59 bx lr
60
61.data
62 .globl symbol
63 .hidden symbol
64symbol: .long 23
653: .long 17
66EOF
67libc_cv_arm_pcrel_movw=no
68${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
69 -nostartfiles -nostdlib -shared \
70 -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
71LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
72{
73 cat conftest.dr 1>&AS_MESSAGE_LOG_FD
74 fgrep 'TEXTREL
75R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
76}
77rm -f conftest*])
78if test $libc_cv_arm_pcrel_movw = yes; then
79 AC_DEFINE([ARM_PCREL_MOVW_OK])
80fi
81
95af4cff
RM
82# This was buggy in assemblers from GNU binutils versions before 2.25.1
83# (it's known to be broken in 2.24 and 2.25; see
84# https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
85AC_CACHE_CHECK([whether TPOFF relocs with addends are assembled correctly],
86 libc_cv_arm_tpoff_addend, [
87cat > conftest.s <<\EOF
88 .syntax unified
89 .arm
90 .arch armv7-a
91
92 .text
93foo:
94 .word tbase(tpoff)+4
95
96 .section .tdata,"awT",%progbits
97 .word -4
98tbase: .word 0
99 .word 4
100EOF
101libc_cv_arm_tpoff_addend=no
102${CC-cc} -c $CFLAGS $CPPFLAGS \
103 -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
104LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&AS_MESSAGE_LOG_FD &&
105{
106 cat conftest.x 1>&AS_MESSAGE_LOG_FD
107 $AWK 'BEGIN { result = 2 }
108$1 ~ /0x0+/ && $2 ~ /[[0-9a-f]]+/ {
109# Check for little-endian or big-endian encoding of 4 in the in-place addend.
110 result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
111}
112END { exit(result) }
113' conftest.x 2>&AS_MESSAGE_LOG_FD && libc_cv_arm_tpoff_addend=yes
114}
115rm -f conftest*])
116if test $libc_cv_arm_tpoff_addend = no; then
117 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign], [yes])
118 LIBC_CONFIG_VAR([test-xfail-tst-tlsalign-static], [yes])
119fi
120
121
37fccd41
RM
122libc_cv_gcc_unwind_find_fde=no
123
124# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
125CFLAGS=${CFLAGS% -fno-unwind-tables}