conformtest: clean up POSIX expectations for unistd.h.
[glibc.git] / sysdeps / arm / configure.ac
blob168f2e7c80169c3204157ff3ee41cff88f1d5fa0
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
19                       yes
20                      #endif
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])
25 else
26   LIBC_CONFIG_VAR([default-abi], [soft])
29 AC_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"])
36 if test $libc_cv_arm_tls_desc = yes; then
37   LIBC_CONFIG_VAR([have-arm-tls-desc], [yes])
38 else
39   LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
42 AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
43                libc_cv_arm_pcrel_movw, [
44 cat > conftest.s <<\EOF
45         .syntax unified
46         .arm
47         .arch armv7-a
49         .text
50         .globl foo
51         .type foo,%function
52 foo:    movw r0, #:lower16:symbol - 1f - 8
53         movt r0, #:upper16:symbol - 1f - 8
54 1:      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
58 2:      add r0, pc
59         bx lr
61 .data
62         .globl symbol
63         .hidden symbol
64 symbol: .long 23
65 3:      .long 17
66 EOF
67 libc_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 &&
71 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
73   cat conftest.dr 1>&AS_MESSAGE_LOG_FD
74   fgrep 'TEXTREL
75 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
77 rm -f conftest*])
78 if test $libc_cv_arm_pcrel_movw = yes; then
79   AC_DEFINE([ARM_PCREL_MOVW_OK])
82 libc_cv_gcc_unwind_find_fde=no
84 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
85 CFLAGS=${CFLAGS% -fno-unwind-tables}
87 dnl The normal configure check for gcc -fexecptions fails because it can't
88 dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
89 dnl has -fexceptions.
90 libc_cv_gcc_exceptions=yes
91 exceptions=-fexceptions