arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372)
[glibc.git] / sysdeps / arm / configure
blob4ef4d46cbd5384e99c186069de56e1c6baa0ab0d
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
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.
13 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
14 printf %s "checking for grep that handles long lines and -e... " >&6; }
15 if test ${ac_cv_path_GREP+y}
16 then :
17   printf %s "(cached) " >&6
18 else $as_nop
19   if test -z "$GREP"; then
20   ac_path_GREP_found=false
21   # Loop through the user's path and test for each of PROGNAME-LIST
22   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
23 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
25   IFS=$as_save_IFS
26   case $as_dir in #(((
27     '') as_dir=./ ;;
28     */) ;;
29     *) as_dir=$as_dir/ ;;
30   esac
31     for ac_prog in grep ggrep
32    do
33     for ac_exec_ext in '' $ac_executable_extensions; do
34       ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
35       as_fn_executable_p "$ac_path_GREP" || continue
36 # Check for GNU ac_path_GREP and select it if it is found.
37   # Check for GNU $ac_path_GREP
38 case `"$ac_path_GREP" --version 2>&1` in
39 *GNU*)
40   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
42   ac_count=0
43   printf %s 0123456789 >"conftest.in"
44   while :
45   do
46     cat "conftest.in" "conftest.in" >"conftest.tmp"
47     mv "conftest.tmp" "conftest.in"
48     cp "conftest.in" "conftest.nl"
49     printf "%s\n" 'GREP' >> "conftest.nl"
50     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
51     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
52     as_fn_arith $ac_count + 1 && ac_count=$as_val
53     if test $ac_count -gt ${ac_path_GREP_max-0}; then
54       # Best one so far, save it but keep looking for a better one
55       ac_cv_path_GREP="$ac_path_GREP"
56       ac_path_GREP_max=$ac_count
57     fi
58     # 10*(2^10) chars as input seems more than enough
59     test $ac_count -gt 10 && break
60   done
61   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
62 esac
64       $ac_path_GREP_found && break 3
65     done
66   done
67   done
68 IFS=$as_save_IFS
69   if test -z "$ac_cv_path_GREP"; then
70     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
71   fi
72 else
73   ac_cv_path_GREP=$GREP
77 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
78 printf "%s\n" "$ac_cv_path_GREP" >&6; }
79  GREP="$ac_cv_path_GREP"
82 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
83 printf %s "checking for egrep... " >&6; }
84 if test ${ac_cv_path_EGREP+y}
85 then :
86   printf %s "(cached) " >&6
87 else $as_nop
88   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
89    then ac_cv_path_EGREP="$GREP -E"
90    else
91      if test -z "$EGREP"; then
92   ac_path_EGREP_found=false
93   # Loop through the user's path and test for each of PROGNAME-LIST
94   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
95 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
97   IFS=$as_save_IFS
98   case $as_dir in #(((
99     '') as_dir=./ ;;
100     */) ;;
101     *) as_dir=$as_dir/ ;;
102   esac
103     for ac_prog in egrep
104    do
105     for ac_exec_ext in '' $ac_executable_extensions; do
106       ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
107       as_fn_executable_p "$ac_path_EGREP" || continue
108 # Check for GNU ac_path_EGREP and select it if it is found.
109   # Check for GNU $ac_path_EGREP
110 case `"$ac_path_EGREP" --version 2>&1` in
111 *GNU*)
112   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
114   ac_count=0
115   printf %s 0123456789 >"conftest.in"
116   while :
117   do
118     cat "conftest.in" "conftest.in" >"conftest.tmp"
119     mv "conftest.tmp" "conftest.in"
120     cp "conftest.in" "conftest.nl"
121     printf "%s\n" 'EGREP' >> "conftest.nl"
122     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
123     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
124     as_fn_arith $ac_count + 1 && ac_count=$as_val
125     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
126       # Best one so far, save it but keep looking for a better one
127       ac_cv_path_EGREP="$ac_path_EGREP"
128       ac_path_EGREP_max=$ac_count
129     fi
130     # 10*(2^10) chars as input seems more than enough
131     test $ac_count -gt 10 && break
132   done
133   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
134 esac
136       $ac_path_EGREP_found && break 3
137     done
138   done
139   done
140 IFS=$as_save_IFS
141   if test -z "$ac_cv_path_EGREP"; then
142     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
143   fi
144 else
145   ac_cv_path_EGREP=$EGREP
148    fi
150 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
151 printf "%s\n" "$ac_cv_path_EGREP" >&6; }
152  EGREP="$ac_cv_path_EGREP"
155 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler is using the ARM hard-float ABI" >&5
156 printf %s "checking whether the compiler is using the ARM hard-float ABI... " >&6; }
157 if test ${libc_cv_arm_pcs_vfp+y}
158 then :
159   printf %s "(cached) " >&6
160 else $as_nop
161   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
162 /* end confdefs.h.  */
163 #ifdef __ARM_PCS_VFP
164                       yes
165                      #endif
167 _ACEOF
168 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
169   $EGREP "yes" >/dev/null 2>&1
170 then :
171   libc_cv_arm_pcs_vfp=yes
172 else $as_nop
173   libc_cv_arm_pcs_vfp=no
175 rm -rf conftest*
178 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp" >&5
179 printf "%s\n" "$libc_cv_arm_pcs_vfp" >&6; }
180 if test $libc_cv_arm_pcs_vfp = yes; then
181   printf "%s\n" "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
183   config_vars="$config_vars
184 default-abi = hard"
185 else
186   config_vars="$config_vars
187 default-abi = soft"
190 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether VFP supports 32 registers" >&5
191 printf %s "checking whether VFP supports 32 registers... " >&6; }
192 if test ${libc_cv_arm_pcs_vfp_d32+y}
193 then :
194   printf %s "(cached) " >&6
195 else $as_nop
197 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
198 /* end confdefs.h.  */
200 void foo (void)
202   asm volatile ("vldr d16,=17" : : : "d16");
205 _ACEOF
206 if ac_fn_c_try_compile "$LINENO"
207 then :
208   libc_cv_arm_pcs_vfp_d32=yes
209 else $as_nop
210   libc_cv_arm_pcs_vfp_d32=no
212 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
214 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp_d32" >&5
215 printf "%s\n" "$libc_cv_arm_pcs_vfp_d32" >&6; }
216 if test "$libc_cv_arm_pcs_vfp_d32" = yes ;
217 then
218   printf "%s\n" "#define HAVE_ARM_PCS_VFP_D32 1" >>confdefs.h
222 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether PC-relative relocs in movw/movt work properly" >&5
223 printf %s "checking whether PC-relative relocs in movw/movt work properly... " >&6; }
224 if test ${libc_cv_arm_pcrel_movw+y}
225 then :
226   printf %s "(cached) " >&6
227 else $as_nop
229 cat > conftest.s <<\EOF
230         .syntax unified
231         .arm
232         .arch armv7-a
234         .text
235         .globl foo
236         .type foo,%function
237 foo:    movw r0, #:lower16:symbol - 1f - 8
238         movt r0, #:upper16:symbol - 1f - 8
239 1:      add r0, pc
240         @ And now a case with a local symbol.
241         movw r0, #:lower16:3f - 2f - 8
242         movt r0, #:upper16:3f - 2f - 8
243 2:      add r0, pc
244         bx lr
246 .data
247         .globl symbol
248         .hidden symbol
249 symbol: .long 23
250 3:      .long 17
252 libc_cv_arm_pcrel_movw=no
253 ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
254          -nostartfiles -nostdlib -shared \
255          -o conftest.so conftest.s 1>&5 2>&5 &&
256 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&5 &&
258   cat conftest.dr 1>&5
259   grep -F 'TEXTREL
260 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
262 rm -f conftest*
264 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcrel_movw" >&5
265 printf "%s\n" "$libc_cv_arm_pcrel_movw" >&6; }
266 if test $libc_cv_arm_pcrel_movw = yes; then
267   printf "%s\n" "#define ARM_PCREL_MOVW_OK 1" >>confdefs.h
271 # This was buggy in assemblers from GNU binutils versions before 2.25.1
272 # (it's known to be broken in 2.24 and 2.25; see
273 # https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
274 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether TPOFF relocs with addends are assembled correctly" >&5
275 printf %s "checking whether TPOFF relocs with addends are assembled correctly... " >&6; }
276 if test ${libc_cv_arm_tpoff_addend+y}
277 then :
278   printf %s "(cached) " >&6
279 else $as_nop
281 cat > conftest.s <<\EOF
282         .syntax unified
283         .arm
284         .arch armv7-a
286         .text
287 foo:
288         .word tbase(tpoff)+4
290         .section .tdata,"awT",%progbits
291         .word -4
292 tbase:  .word 0
293         .word 4
295 libc_cv_arm_tpoff_addend=no
296 ${CC-cc} -c $CFLAGS $CPPFLAGS \
297          -o conftest.o conftest.s 1>&5 2>&5 &&
298 LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&5 &&
300   cat conftest.x 1>&5
301   $AWK 'BEGIN { result = 2 }
302 $1 ~ /0x0+/ && $2 ~ /[0-9a-f]+/ {
303 # Check for little-endian or big-endian encoding of 4 in the in-place addend.
304   result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
306 END { exit(result) }
307 ' conftest.x 2>&5 && libc_cv_arm_tpoff_addend=yes
309 rm -f conftest*
311 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_tpoff_addend" >&5
312 printf "%s\n" "$libc_cv_arm_tpoff_addend" >&6; }
313 if test $libc_cv_arm_tpoff_addend = no; then
314   config_vars="$config_vars
315 test-xfail-tst-tlsalign = yes"
316   config_vars="$config_vars
317 test-xfail-tst-tlsalign-static = yes"
321 libc_cv_gcc_unwind_find_fde=no
323 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
324 CFLAGS=${CFLAGS% -fno-unwind-tables}