mips: FIx clone3 implementation (BZ 31325)
[glibc.git] / sysdeps / unix / sysv / linux / mips / configure
bloba060901de406adb9e880956a32f6b1a6b3ead0a6
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/unix/sysv/linux/mips.
5 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6 /* end confdefs.h.  */
8     #if (_MIPS_SIM != _ABIO32)
9     #error Not O32 ABI
10     #endif
11 int
12 main (void)
15   ;
16   return 0;
18 _ACEOF
19 if ac_fn_c_try_compile "$LINENO"
20 then :
21   libc_mips_abi=o32
22 else $as_nop
23   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24 /* end confdefs.h.  */
26       #if (_MIPS_SIM != _ABIN32)
27       #error Not N32 ABI
28       #endif
29 int
30 main (void)
33   ;
34   return 0;
36 _ACEOF
37 if ac_fn_c_try_compile "$LINENO"
38 then :
39   libc_mips_abi=n32
40 else $as_nop
41   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42 /* end confdefs.h.  */
44         #if (_MIPS_SIM != _ABI64)
45         #error Not 64 ABI
46         #endif
47 int
48 main (void)
51   ;
52   return 0;
54 _ACEOF
55 if ac_fn_c_try_compile "$LINENO"
56 then :
57   libc_mips_abi=n64
59 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
61 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
63 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
65 if test -z "$libc_mips_abi"; then
66   as_fn_error $? "could not determine what ABI the compiler is using" "$LINENO" 5
69 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
70 /* end confdefs.h.  */
72     #if !defined(__mips_soft_float)
73     #error Not soft ABI
74     #endif
75 int
76 main (void)
79   ;
80   return 0;
82 _ACEOF
83 if ac_fn_c_try_compile "$LINENO"
84 then :
85   libc_mips_float=soft
86 else $as_nop
87   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88 /* end confdefs.h.  */
90       #if !defined(__mips_hard_float)
91       #error Not hard ABI
92       #endif
93 int
94 main (void)
97   ;
98   return 0;
100 _ACEOF
101 if ac_fn_c_try_compile "$LINENO"
102 then :
103   libc_mips_float=hard
105 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
107 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
109 if test -z "$libc_mips_float"; then
110   as_fn_error $? "could not determine if compiler is using hard or soft floating point ABI" "$LINENO" 5
113 libc_mips_o32_fp=
114 libc_cv_mips_fp64=
115 libc_cv_mips_modd_spreg=
117 if test x"$libc_mips_abi" = xo32 -a x"$libc_mips_float" = xhard; then
118   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
119 /* end confdefs.h.  */
121       #if !defined(__mips_fpr)
122       #error Missing FPR sizes
123       #endif
125 main (void)
128   ;
129   return 0;
131 _ACEOF
132 if ac_fn_c_try_compile "$LINENO"
133 then :
134   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
135 /* end confdefs.h.  */
137         #if (__mips_fpr != 32)
138         #error Not FP32
139         #endif
141 main (void)
144   ;
145   return 0;
147 _ACEOF
148 if ac_fn_c_try_compile "$LINENO"
149 then :
150   libc_mips_o32_fp=32
151 else $as_nop
152   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
153 /* end confdefs.h.  */
155           #if (__mips_fpr != 0) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
156           #error Not FPXX (without odd single-precision registers)
157           #endif
159 main (void)
162   ;
163   return 0;
165 _ACEOF
166 if ac_fn_c_try_compile "$LINENO"
167 then :
168   libc_mips_o32_fp=xx
169 else $as_nop
170   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
171 /* end confdefs.h.  */
173             #if (__mips_fpr != 0)
174             #error Not FPXX (with odd single precision registers)
175             #endif
177 main (void)
180   ;
181   return 0;
183 _ACEOF
184 if ac_fn_c_try_compile "$LINENO"
185 then :
186   libc_mips_o32_fp=xxo
187 else $as_nop
188   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
189 /* end confdefs.h.  */
191               #if (__mips_fpr != 64) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
192               #error Not FP64A
193               #endif
195 main (void)
198   ;
199   return 0;
201 _ACEOF
202 if ac_fn_c_try_compile "$LINENO"
203 then :
204   libc_mips_o32_fp=64a
205 else $as_nop
206   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
207 /* end confdefs.h.  */
209                 #if (__mips_fpr != 64)
210                 #error Not FP64
211                 #endif
213 main (void)
216   ;
217   return 0;
219 _ACEOF
220 if ac_fn_c_try_compile "$LINENO"
221 then :
222   libc_mips_o32_fp=64
224 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
226 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
228 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
230 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
232 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
234 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
236   if { ac_try='${CC-cc} -mfp64 -xc /dev/null -S -o /dev/null'
237   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
238   (eval $ac_try) 2>&5
239   ac_status=$?
240   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
241   test $ac_status = 0; }; }
242 then :
243   libc_cv_mips_fp64=yes
244 else $as_nop
245   libc_cv_mips_fp64=no
247   if { ac_try='${CC-cc} -Werror -modd-spreg -xc /dev/null -S -o /dev/null'
248   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
249   (eval $ac_try) 2>&5
250   ac_status=$?
251   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
252   test $ac_status = 0; }; }
253 then :
254   libc_cv_mips_modd_spreg=yes
255 else $as_nop
256   libc_cv_mips_modd_spreg=no
259 config_vars="$config_vars
260 o32-fpabi = ${libc_mips_o32_fp}"
261 config_vars="$config_vars
262 has-mpf64 = ${libc_cv_mips_fp64}"
263 config_vars="$config_vars
264 has-modd-spreg = ${libc_cv_mips_modd_spreg}"
266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
267 /* end confdefs.h.  */
269     #include <linux/prctl.h>
270     #if !defined(PR_GET_FP_MODE) || !defined(PR_SET_FP_MODE)
271     #error New prctl support for setting FP modes not found
272     #endif
274 main (void)
277   ;
278   return 0;
280 _ACEOF
281 if ac_fn_c_try_compile "$LINENO"
282 then :
283   libc_mips_mode_switch=yes
284 else $as_nop
285   libc_mips_mode_switch=no
287 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
288 config_vars="$config_vars
289 mips-mode-switch = ${libc_mips_mode_switch}"
292 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
293 printf %s "checking for grep that handles long lines and -e... " >&6; }
294 if test ${ac_cv_path_GREP+y}
295 then :
296   printf %s "(cached) " >&6
297 else $as_nop
298   if test -z "$GREP"; then
299   ac_path_GREP_found=false
300   # Loop through the user's path and test for each of PROGNAME-LIST
301   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
302 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
304   IFS=$as_save_IFS
305   case $as_dir in #(((
306     '') as_dir=./ ;;
307     */) ;;
308     *) as_dir=$as_dir/ ;;
309   esac
310     for ac_prog in grep ggrep
311    do
312     for ac_exec_ext in '' $ac_executable_extensions; do
313       ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
314       as_fn_executable_p "$ac_path_GREP" || continue
315 # Check for GNU ac_path_GREP and select it if it is found.
316   # Check for GNU $ac_path_GREP
317 case `"$ac_path_GREP" --version 2>&1` in
318 *GNU*)
319   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
321   ac_count=0
322   printf %s 0123456789 >"conftest.in"
323   while :
324   do
325     cat "conftest.in" "conftest.in" >"conftest.tmp"
326     mv "conftest.tmp" "conftest.in"
327     cp "conftest.in" "conftest.nl"
328     printf "%s\n" 'GREP' >> "conftest.nl"
329     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
330     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
331     as_fn_arith $ac_count + 1 && ac_count=$as_val
332     if test $ac_count -gt ${ac_path_GREP_max-0}; then
333       # Best one so far, save it but keep looking for a better one
334       ac_cv_path_GREP="$ac_path_GREP"
335       ac_path_GREP_max=$ac_count
336     fi
337     # 10*(2^10) chars as input seems more than enough
338     test $ac_count -gt 10 && break
339   done
340   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
341 esac
343       $ac_path_GREP_found && break 3
344     done
345   done
346   done
347 IFS=$as_save_IFS
348   if test -z "$ac_cv_path_GREP"; then
349     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
350   fi
351 else
352   ac_cv_path_GREP=$GREP
356 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
357 printf "%s\n" "$ac_cv_path_GREP" >&6; }
358  GREP="$ac_cv_path_GREP"
361 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
362 printf %s "checking for egrep... " >&6; }
363 if test ${ac_cv_path_EGREP+y}
364 then :
365   printf %s "(cached) " >&6
366 else $as_nop
367   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
368    then ac_cv_path_EGREP="$GREP -E"
369    else
370      if test -z "$EGREP"; then
371   ac_path_EGREP_found=false
372   # Loop through the user's path and test for each of PROGNAME-LIST
373   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
374 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
376   IFS=$as_save_IFS
377   case $as_dir in #(((
378     '') as_dir=./ ;;
379     */) ;;
380     *) as_dir=$as_dir/ ;;
381   esac
382     for ac_prog in egrep
383    do
384     for ac_exec_ext in '' $ac_executable_extensions; do
385       ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
386       as_fn_executable_p "$ac_path_EGREP" || continue
387 # Check for GNU ac_path_EGREP and select it if it is found.
388   # Check for GNU $ac_path_EGREP
389 case `"$ac_path_EGREP" --version 2>&1` in
390 *GNU*)
391   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
393   ac_count=0
394   printf %s 0123456789 >"conftest.in"
395   while :
396   do
397     cat "conftest.in" "conftest.in" >"conftest.tmp"
398     mv "conftest.tmp" "conftest.in"
399     cp "conftest.in" "conftest.nl"
400     printf "%s\n" 'EGREP' >> "conftest.nl"
401     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
402     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
403     as_fn_arith $ac_count + 1 && ac_count=$as_val
404     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
405       # Best one so far, save it but keep looking for a better one
406       ac_cv_path_EGREP="$ac_path_EGREP"
407       ac_path_EGREP_max=$ac_count
408     fi
409     # 10*(2^10) chars as input seems more than enough
410     test $ac_count -gt 10 && break
411   done
412   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
413 esac
415       $ac_path_EGREP_found && break 3
416     done
417   done
418   done
419 IFS=$as_save_IFS
420   if test -z "$ac_cv_path_EGREP"; then
421     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
422   fi
423 else
424   ac_cv_path_EGREP=$EGREP
427    fi
429 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
430 printf "%s\n" "$ac_cv_path_EGREP" >&6; }
431  EGREP="$ac_cv_path_EGREP"
434 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler is using the 2008 NaN encoding" >&5
435 printf %s "checking whether the compiler is using the 2008 NaN encoding... " >&6; }
436 if test ${libc_cv_mips_nan2008+y}
437 then :
438   printf %s "(cached) " >&6
439 else $as_nop
440   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
441 /* end confdefs.h.  */
443 #ifdef __mips_nan2008
445 #endif
446 _ACEOF
447 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
448   $EGREP "yes" >/dev/null 2>&1
449 then :
450   libc_cv_mips_nan2008=yes
451 else $as_nop
452   libc_cv_mips_nan2008=no
454 rm -rf conftest*
457 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mips_nan2008" >&5
458 printf "%s\n" "$libc_cv_mips_nan2008" >&6; }
460 libc_mips_nan=
461 if test x"$libc_cv_mips_nan2008" = xyes; then
462   libc_mips_nan=_2008
465 config_vars="$config_vars
466 default-abi = ${libc_mips_abi}_${libc_mips_float}${libc_mips_nan}"
468 case $machine in
469 mips/mips64/n64/*)
470   test -n "$libc_cv_slibdir" ||
471 case "$prefix" in
472 /usr | /usr/)
473   libc_cv_slibdir='/lib64'
474   libc_cv_rtlddir='/lib64'
475   if test "$libdir" = '${exec_prefix}/lib'; then
476     libdir='${exec_prefix}/lib64';
477     # Locale data can be shared between 32-bit and 64-bit libraries.
478     libc_cv_complocaledir='${exec_prefix}/lib/locale'
479   fi
480   ;;
481 esac
482   ;;
483 mips/mips64/n32/*)
484   test -n "$libc_cv_slibdir" ||
485 case "$prefix" in
486 /usr | /usr/)
487   libc_cv_slibdir='/lib32'
488   libc_cv_rtlddir='/lib32'
489   if test "$libdir" = '${exec_prefix}/lib'; then
490     libdir='${exec_prefix}/lib32';
491     # Locale data can be shared between 32-bit and 64-bit libraries.
492     libc_cv_complocaledir='${exec_prefix}/lib/locale'
493   fi
494   ;;
495 esac
496   ;;
497 esac
499 libc_cv_gcc_unwind_find_fde=yes
501 if test -z "$arch_minimum_kernel"; then
502   if test x$libc_cv_mips_nan2008 = xyes; then
503     arch_minimum_kernel=4.5.0
504   fi
507 # Check if we are supposed to run on kernels older than 4.8.0. If so,
508 # force executable stack to avoid potential runtime problems with fpu
509 # emulation.
510 # NOTE: The check below assumes that in absence of user-provided minimum_kernel
511 # we will default to arch_minimum_kernel which is currently less than 4.8.0 for
512 # all known configurations. If this changes, the check must be updated.
513 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler must use executable stack" >&5
514 printf %s "checking whether the compiler must use executable stack... " >&6; }
515 if test ${libc_cv_mips_force_execstack+y}
516 then :
517   printf %s "(cached) " >&6
518 else $as_nop
519   libc_cv_mips_force_execstack=no
520   if test $libc_mips_float = hard; then
521     if test -n "$minimum_kernel"; then
523        min_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
525        if test $min_version -lt 264192; then
526          libc_cv_mips_force_execstack=yes
527        fi
528     else
529       libc_cv_mips_force_execstack=yes
530     fi
531   fi
533 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mips_force_execstack" >&5
534 printf "%s\n" "$libc_cv_mips_force_execstack" >&6; }
536 libc_mips_has_gnustack=$libc_cv_as_noexecstack
538 if test $libc_cv_mips_force_execstack = yes; then
539   libc_mips_has_gnustack=no
540   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: forcing executable stack for pre-4.8.0 Linux kernels" >&5
541 printf "%s\n" "$as_me: WARNING: forcing executable stack for pre-4.8.0 Linux kernels" >&2;}
544 config_vars="$config_vars
545 mips-force-execstack = ${libc_cv_mips_force_execstack}"
546 config_vars="$config_vars
547 mips-has-gnustack = ${libc_mips_has_gnustack}"