check_native: Get rid of alloca
[glibc.git] / sysdeps / arm / configure
blob5b0237e52133e37ad7b27bfcbdc27be94bb473ad
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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
14 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
15 if ${ac_cv_path_GREP+:} false; then :
16   $as_echo_n "(cached) " >&6
17 else
18   if test -z "$GREP"; then
19   ac_path_GREP_found=false
20   # Loop through the user's path and test for each of PROGNAME-LIST
21   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
22 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
24   IFS=$as_save_IFS
25   test -z "$as_dir" && as_dir=.
26     for ac_prog in grep ggrep; do
27     for ac_exec_ext in '' $ac_executable_extensions; do
28       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
29       as_fn_executable_p "$ac_path_GREP" || continue
30 # Check for GNU ac_path_GREP and select it if it is found.
31   # Check for GNU $ac_path_GREP
32 case `"$ac_path_GREP" --version 2>&1` in
33 *GNU*)
34   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
36   ac_count=0
37   $as_echo_n 0123456789 >"conftest.in"
38   while :
39   do
40     cat "conftest.in" "conftest.in" >"conftest.tmp"
41     mv "conftest.tmp" "conftest.in"
42     cp "conftest.in" "conftest.nl"
43     $as_echo 'GREP' >> "conftest.nl"
44     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
45     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
46     as_fn_arith $ac_count + 1 && ac_count=$as_val
47     if test $ac_count -gt ${ac_path_GREP_max-0}; then
48       # Best one so far, save it but keep looking for a better one
49       ac_cv_path_GREP="$ac_path_GREP"
50       ac_path_GREP_max=$ac_count
51     fi
52     # 10*(2^10) chars as input seems more than enough
53     test $ac_count -gt 10 && break
54   done
55   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
56 esac
58       $ac_path_GREP_found && break 3
59     done
60   done
61   done
62 IFS=$as_save_IFS
63   if test -z "$ac_cv_path_GREP"; then
64     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
65   fi
66 else
67   ac_cv_path_GREP=$GREP
71 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
72 $as_echo "$ac_cv_path_GREP" >&6; }
73  GREP="$ac_cv_path_GREP"
76 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
77 $as_echo_n "checking for egrep... " >&6; }
78 if ${ac_cv_path_EGREP+:} false; then :
79   $as_echo_n "(cached) " >&6
80 else
81   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
82    then ac_cv_path_EGREP="$GREP -E"
83    else
84      if test -z "$EGREP"; then
85   ac_path_EGREP_found=false
86   # Loop through the user's path and test for each of PROGNAME-LIST
87   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
88 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
90   IFS=$as_save_IFS
91   test -z "$as_dir" && as_dir=.
92     for ac_prog in egrep; do
93     for ac_exec_ext in '' $ac_executable_extensions; do
94       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
95       as_fn_executable_p "$ac_path_EGREP" || continue
96 # Check for GNU ac_path_EGREP and select it if it is found.
97   # Check for GNU $ac_path_EGREP
98 case `"$ac_path_EGREP" --version 2>&1` in
99 *GNU*)
100   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
102   ac_count=0
103   $as_echo_n 0123456789 >"conftest.in"
104   while :
105   do
106     cat "conftest.in" "conftest.in" >"conftest.tmp"
107     mv "conftest.tmp" "conftest.in"
108     cp "conftest.in" "conftest.nl"
109     $as_echo 'EGREP' >> "conftest.nl"
110     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
111     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
112     as_fn_arith $ac_count + 1 && ac_count=$as_val
113     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
114       # Best one so far, save it but keep looking for a better one
115       ac_cv_path_EGREP="$ac_path_EGREP"
116       ac_path_EGREP_max=$ac_count
117     fi
118     # 10*(2^10) chars as input seems more than enough
119     test $ac_count -gt 10 && break
120   done
121   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
122 esac
124       $ac_path_EGREP_found && break 3
125     done
126   done
127   done
128 IFS=$as_save_IFS
129   if test -z "$ac_cv_path_EGREP"; then
130     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
131   fi
132 else
133   ac_cv_path_EGREP=$EGREP
136    fi
138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
139 $as_echo "$ac_cv_path_EGREP" >&6; }
140  EGREP="$ac_cv_path_EGREP"
143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is using the ARM hard-float ABI" >&5
144 $as_echo_n "checking whether the compiler is using the ARM hard-float ABI... " >&6; }
145 if ${libc_cv_arm_pcs_vfp+:} false; then :
146   $as_echo_n "(cached) " >&6
147 else
148   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
149 /* end confdefs.h.  */
150 #ifdef __ARM_PCS_VFP
151                       yes
152                      #endif
154 _ACEOF
155 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
156   $EGREP "yes" >/dev/null 2>&1; then :
157   libc_cv_arm_pcs_vfp=yes
158 else
159   libc_cv_arm_pcs_vfp=no
161 rm -f conftest*
164 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp" >&5
165 $as_echo "$libc_cv_arm_pcs_vfp" >&6; }
166 if test $libc_cv_arm_pcs_vfp = yes; then
167   $as_echo "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
169   config_vars="$config_vars
170 default-abi = hard"
171 else
172   config_vars="$config_vars
173 default-abi = soft"
176 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PC-relative relocs in movw/movt work properly" >&5
177 $as_echo_n "checking whether PC-relative relocs in movw/movt work properly... " >&6; }
178 if ${libc_cv_arm_pcrel_movw+:} false; then :
179   $as_echo_n "(cached) " >&6
180 else
182 cat > conftest.s <<\EOF
183         .syntax unified
184         .arm
185         .arch armv7-a
187         .text
188         .globl foo
189         .type foo,%function
190 foo:    movw r0, #:lower16:symbol - 1f - 8
191         movt r0, #:upper16:symbol - 1f - 8
192 1:      add r0, pc
193         @ And now a case with a local symbol.
194         movw r0, #:lower16:3f - 2f - 8
195         movt r0, #:upper16:3f - 2f - 8
196 2:      add r0, pc
197         bx lr
199 .data
200         .globl symbol
201         .hidden symbol
202 symbol: .long 23
203 3:      .long 17
205 libc_cv_arm_pcrel_movw=no
206 ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
207          -nostartfiles -nostdlib -shared \
208          -o conftest.so conftest.s 1>&5 2>&5 &&
209 LC_ALL=C $READELF -dr conftest.so > conftest.dr 2>&5 &&
211   cat conftest.dr 1>&5
212   grep -F 'TEXTREL
213 R_ARM_NONE' conftest.dr > /dev/null || libc_cv_arm_pcrel_movw=yes
215 rm -f conftest*
217 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcrel_movw" >&5
218 $as_echo "$libc_cv_arm_pcrel_movw" >&6; }
219 if test $libc_cv_arm_pcrel_movw = yes; then
220   $as_echo "#define ARM_PCREL_MOVW_OK 1" >>confdefs.h
224 # This was buggy in assemblers from GNU binutils versions before 2.25.1
225 # (it's known to be broken in 2.24 and 2.25; see
226 # https://sourceware.org/bugzilla/show_bug.cgi?id=18383).
227 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TPOFF relocs with addends are assembled correctly" >&5
228 $as_echo_n "checking whether TPOFF relocs with addends are assembled correctly... " >&6; }
229 if ${libc_cv_arm_tpoff_addend+:} false; then :
230   $as_echo_n "(cached) " >&6
231 else
233 cat > conftest.s <<\EOF
234         .syntax unified
235         .arm
236         .arch armv7-a
238         .text
239 foo:
240         .word tbase(tpoff)+4
242         .section .tdata,"awT",%progbits
243         .word -4
244 tbase:  .word 0
245         .word 4
247 libc_cv_arm_tpoff_addend=no
248 ${CC-cc} -c $CFLAGS $CPPFLAGS \
249          -o conftest.o conftest.s 1>&5 2>&5 &&
250 LC_ALL=C $READELF -x.text conftest.o > conftest.x 2>&5 &&
252   cat conftest.x 1>&5
253   $AWK 'BEGIN { result = 2 }
254 $1 ~ /0x0+/ && $2 ~ /[0-9a-f]+/ {
255 # Check for little-endian or big-endian encoding of 4 in the in-place addend.
256   result = ($2 == "04000000" || $2 == "00000004") ? 0 : 1
258 END { exit(result) }
259 ' conftest.x 2>&5 && libc_cv_arm_tpoff_addend=yes
261 rm -f conftest*
263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_tpoff_addend" >&5
264 $as_echo "$libc_cv_arm_tpoff_addend" >&6; }
265 if test $libc_cv_arm_tpoff_addend = no; then
266   config_vars="$config_vars
267 test-xfail-tst-tlsalign = yes"
268   config_vars="$config_vars
269 test-xfail-tst-tlsalign-static = yes"
273 libc_cv_gcc_unwind_find_fde=no
275 # Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
276 CFLAGS=${CFLAGS% -fno-unwind-tables}