mips: FIx clone3 implementation (BZ 31325)
[glibc.git] / sysdeps / aarch64 / configure
blobca57edce472e4507480802acbcb31ca0d2d42af3
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/aarch64.
4 # Static PIE is supported.
5 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
8 # We check to see if the compiler and flags are
9 # selecting the big endian ABI and if they are then
10 # we set libc_cv_aarch64_be to yes which causes
11 # HAVE_AARCH64_BE to be defined in config.h and
12 # in include/libc-symbols.h and thus available to
13 # shlib-versions to select the appropriate name for
14 # the dynamic linker via %ifdef.
17 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
18 printf %s "checking for grep that handles long lines and -e... " >&6; }
19 if test ${ac_cv_path_GREP+y}
20 then :
21   printf %s "(cached) " >&6
22 else $as_nop
23   if test -z "$GREP"; then
24   ac_path_GREP_found=false
25   # Loop through the user's path and test for each of PROGNAME-LIST
26   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
27 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
29   IFS=$as_save_IFS
30   case $as_dir in #(((
31     '') as_dir=./ ;;
32     */) ;;
33     *) as_dir=$as_dir/ ;;
34   esac
35     for ac_prog in grep ggrep
36    do
37     for ac_exec_ext in '' $ac_executable_extensions; do
38       ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
39       as_fn_executable_p "$ac_path_GREP" || continue
40 # Check for GNU ac_path_GREP and select it if it is found.
41   # Check for GNU $ac_path_GREP
42 case `"$ac_path_GREP" --version 2>&1` in
43 *GNU*)
44   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
46   ac_count=0
47   printf %s 0123456789 >"conftest.in"
48   while :
49   do
50     cat "conftest.in" "conftest.in" >"conftest.tmp"
51     mv "conftest.tmp" "conftest.in"
52     cp "conftest.in" "conftest.nl"
53     printf "%s\n" 'GREP' >> "conftest.nl"
54     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
55     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
56     as_fn_arith $ac_count + 1 && ac_count=$as_val
57     if test $ac_count -gt ${ac_path_GREP_max-0}; then
58       # Best one so far, save it but keep looking for a better one
59       ac_cv_path_GREP="$ac_path_GREP"
60       ac_path_GREP_max=$ac_count
61     fi
62     # 10*(2^10) chars as input seems more than enough
63     test $ac_count -gt 10 && break
64   done
65   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
66 esac
68       $ac_path_GREP_found && break 3
69     done
70   done
71   done
72 IFS=$as_save_IFS
73   if test -z "$ac_cv_path_GREP"; then
74     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
75   fi
76 else
77   ac_cv_path_GREP=$GREP
81 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
82 printf "%s\n" "$ac_cv_path_GREP" >&6; }
83  GREP="$ac_cv_path_GREP"
86 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
87 printf %s "checking for egrep... " >&6; }
88 if test ${ac_cv_path_EGREP+y}
89 then :
90   printf %s "(cached) " >&6
91 else $as_nop
92   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
93    then ac_cv_path_EGREP="$GREP -E"
94    else
95      if test -z "$EGREP"; then
96   ac_path_EGREP_found=false
97   # Loop through the user's path and test for each of PROGNAME-LIST
98   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
99 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
101   IFS=$as_save_IFS
102   case $as_dir in #(((
103     '') as_dir=./ ;;
104     */) ;;
105     *) as_dir=$as_dir/ ;;
106   esac
107     for ac_prog in egrep
108    do
109     for ac_exec_ext in '' $ac_executable_extensions; do
110       ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
111       as_fn_executable_p "$ac_path_EGREP" || continue
112 # Check for GNU ac_path_EGREP and select it if it is found.
113   # Check for GNU $ac_path_EGREP
114 case `"$ac_path_EGREP" --version 2>&1` in
115 *GNU*)
116   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
118   ac_count=0
119   printf %s 0123456789 >"conftest.in"
120   while :
121   do
122     cat "conftest.in" "conftest.in" >"conftest.tmp"
123     mv "conftest.tmp" "conftest.in"
124     cp "conftest.in" "conftest.nl"
125     printf "%s\n" 'EGREP' >> "conftest.nl"
126     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
127     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
128     as_fn_arith $ac_count + 1 && ac_count=$as_val
129     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
130       # Best one so far, save it but keep looking for a better one
131       ac_cv_path_EGREP="$ac_path_EGREP"
132       ac_path_EGREP_max=$ac_count
133     fi
134     # 10*(2^10) chars as input seems more than enough
135     test $ac_count -gt 10 && break
136   done
137   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
138 esac
140       $ac_path_EGREP_found && break 3
141     done
142   done
143   done
144 IFS=$as_save_IFS
145   if test -z "$ac_cv_path_EGREP"; then
146     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
147   fi
148 else
149   ac_cv_path_EGREP=$EGREP
152    fi
154 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
155 printf "%s\n" "$ac_cv_path_EGREP" >&6; }
156  EGREP="$ac_cv_path_EGREP"
159 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
160 printf %s "checking for big endian... " >&6; }
161 if test ${libc_cv_aarch64_be+y}
162 then :
163   printf %s "(cached) " >&6
164 else $as_nop
165   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
166 /* end confdefs.h.  */
167 #ifdef __AARCH64EB__
168                       yes
169                      #endif
171 _ACEOF
172 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
173   $EGREP "yes" >/dev/null 2>&1
174 then :
175   libc_cv_aarch64_be=yes
176 else $as_nop
177   libc_cv_aarch64_be=no
179 rm -rf conftest*
182 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_be" >&5
183 printf "%s\n" "$libc_cv_aarch64_be" >&6; }
184 if test $libc_cv_aarch64_be = yes; then
185   printf "%s\n" "#define HAVE_AARCH64_BE 1" >>confdefs.h
187   config_vars="$config_vars
188 default-abi = lp64_be"
189 else
190   config_vars="$config_vars
191 default-abi = lp64"
194 # Only consider BTI supported if -mbranch-protection=bti is
195 # on by default in the compiler and the linker produces
196 # binaries with GNU property notes in PT_GNU_PROPERTY segment.
197 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BTI support" >&5
198 printf %s "checking for BTI support... " >&6; }
199 if test ${libc_cv_aarch64_bti+y}
200 then :
201   printf %s "(cached) " >&6
202 else $as_nop
203     cat > conftest.c <<EOF
204 void foo (void) { }
206   libc_cv_aarch64_bti=no
207   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o conftest.so conftest.c'
208   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
209   (eval $ac_try) 2>&5
210   ac_status=$?
211   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
212   test $ac_status = 0; }; } \
213      && { ac_try='$READELF -lW conftest.so | grep -q GNU_PROPERTY'
214   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
215   (eval $ac_try) 2>&5
216   ac_status=$?
217   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
218   test $ac_status = 0; }; } \
219      && { ac_try='$READELF -nW conftest.so | grep -q "NT_GNU_PROPERTY_TYPE_0.*AArch64 feature:.* BTI"'
220   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
221   (eval $ac_try) 2>&5
222   ac_status=$?
223   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
224   test $ac_status = 0; }; }
225   then
226     libc_cv_aarch64_bti=yes
227   fi
228   rm -rf conftest.*
230 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_bti" >&5
231 printf "%s\n" "$libc_cv_aarch64_bti" >&6; }
232 config_vars="$config_vars
233 aarch64-bti = $libc_cv_aarch64_bti"
234 if test $libc_cv_aarch64_bti = yes; then
235   printf "%s\n" "#define HAVE_AARCH64_BTI 1" >>confdefs.h
239 # Check if glibc is built with return address signing, i.e.
240 # if -mbranch-protection=pac-ret is on. We need this because
241 # pac-ret relies on unwinder support so it's not safe to use
242 # it in assembly code unconditionally, but there is no
243 # feature test macro for it in gcc.
244 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pac-ret is enabled" >&5
245 printf %s "checking if pac-ret is enabled... " >&6; }
246 if test ${libc_cv_aarch64_pac_ret+y}
247 then :
248   printf %s "(cached) " >&6
249 else $as_nop
250     cat > conftest.c <<EOF
251 int bar (void);
252 int foo (void) { return bar () + 1; }
254   libc_cv_aarch64_pac_ret=no
255   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -o conftest.s conftest.c'
256   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
257   (eval $ac_try) 2>&5
258   ac_status=$?
259   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
260   test $ac_status = 0; }; } \
261      && { ac_try='grep -q -E '\''(hint( |       )+25|paciasp)'\'' conftest.s'
262   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
263   (eval $ac_try) 2>&5
264   ac_status=$?
265   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
266   test $ac_status = 0; }; }
267   then
268     libc_cv_aarch64_pac_ret=yes
269   fi
270   rm -rf conftest.*
272 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_pac_ret" >&5
273 printf "%s\n" "$libc_cv_aarch64_pac_ret" >&6; }
274 if test $libc_cv_aarch64_pac_ret = yes; then
275   printf "%s\n" "#define HAVE_AARCH64_PAC_RET 1" >>confdefs.h
279 # Check if binutils supports variant PCS symbols.
280 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variant PCS support" >&5
281 printf %s "checking for variant PCS support... " >&6; }
282 if test ${libc_cv_aarch64_variant_pcs+y}
283 then :
284   printf %s "(cached) " >&6
285 else $as_nop
286     cat > conftest.S <<EOF
287 .global foo
288 .type foo, %function
289 .variant_pcs foo
290 foo:
291         ret
292 .global bar
293 .type bar, %function
294 bar:
295         b foo
297   libc_cv_aarch64_variant_pcs=no
298   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -nostdlib -nostartfiles $no_ssp -shared -fPIC -o conftest.so conftest.S'
299   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
300   (eval $ac_try) 2>&5
301   ac_status=$?
302   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
303   test $ac_status = 0; }; } \
304      && { ac_try='$READELF -dW conftest.so | grep -q AARCH64_VARIANT_PCS'
305   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
306   (eval $ac_try) 2>&5
307   ac_status=$?
308   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
309   test $ac_status = 0; }; }
310   then
311     libc_cv_aarch64_variant_pcs=yes
312   fi
313   rm -rf conftest.*
315 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_variant_pcs" >&5
316 printf "%s\n" "$libc_cv_aarch64_variant_pcs" >&6; }
317 config_vars="$config_vars
318 aarch64-variant-pcs = $libc_cv_aarch64_variant_pcs"
320 # Check if asm support armv8.2-a+sve
321 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SVE support in assembler" >&5
322 printf %s "checking for SVE support in assembler... " >&6; }
323 if test ${libc_cv_aarch64_sve_asm+y}
324 then :
325   printf %s "(cached) " >&6
326 else $as_nop
327   cat > conftest.s <<\EOF
328         ptrue p0.b
330 if { ac_try='${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&5'
331   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
332   (eval $ac_try) 2>&5
333   ac_status=$?
334   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
335   test $ac_status = 0; }; }; then
336   libc_cv_aarch64_sve_asm=yes
337 else
338   libc_cv_aarch64_sve_asm=no
340 rm -f conftest*
342 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_sve_asm" >&5
343 printf "%s\n" "$libc_cv_aarch64_sve_asm" >&6; }
344 if test $libc_cv_aarch64_sve_asm = yes; then
345   printf "%s\n" "#define HAVE_AARCH64_SVE_ASM 1" >>confdefs.h
349 if test x"$build_mathvec" = xnotset; then
350   build_mathvec=yes
353 # Check if compiler supports SVE ACLE.
354 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for availability of SVE ACLE" >&5
355 printf %s "checking for availability of SVE ACLE... " >&6; }
356 if test ${libc_cv_aarch64_sve_acle+y}
357 then :
358   printf %s "(cached) " >&6
359 else $as_nop
360     cat > conftest.c <<EOF
361 #include <arm_sve.h>
363   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c'
364   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
365   (eval $ac_try) 2>&5
366   ac_status=$?
367   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
368   test $ac_status = 0; }; }; then
369     libc_cv_aarch64_sve_acle=yes
370   else
371     libc_cv_aarch64_sve_acle=no
372   fi
373   rm conftest.c
375 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_sve_acle" >&5
376 printf "%s\n" "$libc_cv_aarch64_sve_acle" >&6; }
378 # Check if compiler is sufficient to build mathvec
379 if test $build_mathvec = yes; then
380   fail=no
381   if test $libc_cv_aarch64_variant_pcs = no; then
382     fail=yes
383     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but linker does not support variant PCS." >&5
384 printf "%s\n" "$as_me: WARNING: mathvec is enabled but linker does not support variant PCS." >&2;}
385   fi
386   if test $libc_cv_aarch64_sve_asm = no; then
387     fail=yes
388     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but assembler does not support SVE." >&5
389 printf "%s\n" "$as_me: WARNING: mathvec is enabled but assembler does not support SVE." >&2;}
390   fi
391   if test $libc_cv_aarch64_sve_acle = no; then
392     fail=yes
393     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is enabled but compiler does not have SVE ACLE." >&5
394 printf "%s\n" "$as_me: WARNING: mathvec is enabled but compiler does not have SVE ACLE." >&2;}
395   fi
396   if test $fail = yes; then
397     as_fn_error $? "use a compatible toolchain or configure with --disable-mathvec (this results in incomplete ABI)." "$LINENO" 5
398   fi
399 else
400   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: mathvec is disabled, this results in incomplete ABI." >&5
401 printf "%s\n" "$as_me: WARNING: mathvec is disabled, this results in incomplete ABI." >&2;}