Fix semaphore destruction (bug 12674).
[glibc.git] / sysdeps / arm / configure.ac
blob002b8ef365ad9892b84612146e85c1e336577fd4
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.
6 dnl NOTE: This feature was added by the GCC TLS patches.  We should test for
7 dnl it.  Until we do, don't define it.
8 #AC_DEFINE(PI_STATIC_AND_HIDDEN)
10 # We check to see if the compiler and flags are
11 # selecting the hard-float ABI and if they are then
12 # we set libc_cv_arm_pcs_vfp to yes which causes
13 # HAVE_ARM_PCS_VFP to be defined in config.h and
14 # in include/libc-symbols.h and thus available to
15 # shlib-versions to select the appropriate name for
16 # the dynamic linker via %ifdef.
17 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
18   [libc_cv_arm_pcs_vfp],
19   [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
20                       yes
21                      #endif
22   ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
23 if test $libc_cv_arm_pcs_vfp = yes; then
24   AC_DEFINE(HAVE_ARM_PCS_VFP)
25   LIBC_CONFIG_VAR([default-abi], [hard])
26 else
27   LIBC_CONFIG_VAR([default-abi], [soft])
30 AC_CACHE_CHECK([whether the build tools support the GNU descriptor TLS scheme],
31   [libc_cv_arm_tls_desc],
32   [old_CFLAGS="$CFLAGS"
33   CFLAGS="$CFLAGS -mtls-dialect=gnu2"
34   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([asm (".word\tfoo(tlsdesc)");], [])],
35     [libc_cv_arm_tls_desc=yes], [libc_cv_arm_tls_desc=no])
36   CFLAGS="$old_CFLAGS"])
37 if test $libc_cv_arm_tls_desc = yes; then
38   LIBC_CONFIG_VAR([have-arm-tls-desc], [yes])
39 else
40   LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
43 AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
44                libc_cv_arm_pcrel_movw, [
45 cat > conftest.s <<\EOF
46         .syntax unified
47         .arm
48         .arch armv7-a
50         .text
51         .globl foo
52         .type foo,%function
53 foo:    movw r0, #:lower16:symbol - 1f - 8
54         movt r0, #:upper16:symbol - 1f - 8
55 1:      add r0, pc
56         @ And now a case with a local symbol.
57         movw r0, #:lower16:3f - 2f - 8
58         movt r0, #:upper16:3f - 2f - 8
59 2:      add r0, pc
60         bx lr
62 .data
63         .globl symbol
64         .hidden symbol
65 symbol: .long 23
66 3:      .long 17
67 EOF
68 libc_cv_arm_pcrel_movw=no
69 ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
70          -nostartfiles -nostdlib -shared \
71          -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD &&
72 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&AS_MESSAGE_LOG_FD &&
74   cat conftest.dr 1>&AS_MESSAGE_LOG_FD
75   fgrep 'TEXTREL
76 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
78 rm -f conftest*])
79 if test $libc_cv_arm_pcrel_movw = yes; then
80   AC_DEFINE([ARM_PCREL_MOVW_OK])
83 libc_cv_gcc_unwind_find_fde=no
85 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
86 CFLAGS=${CFLAGS% -fno-unwind-tables}
88 dnl The normal configure check for gcc -fexecptions fails because it can't
89 dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
90 dnl has -fexceptions.
91 libc_cv_gcc_exceptions=yes
92 exceptions=-fexceptions