1 sinclude(./aclocal.m4)dnl Autoconf lossage
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
3 # Local configure fragment for sysdeps/unix/sysv/linux/mips.
7 #if (_MIPS_SIM != _ABIO32)
13 #if (_MIPS_SIM != _ABIN32)
19 #if (_MIPS_SIM != _ABI64)
25 if test -z "$libc_mips_abi"; then
26 AC_MSG_ERROR([could not determine what ABI the compiler is using])
31 #if !defined(__mips_soft_float)
34 [libc_mips_float=soft],
37 #if !defined(__mips_hard_float)
40 [libc_mips_float=hard],
43 if test -z "$libc_mips_float"; then
44 AC_MSG_ERROR([could not determine if compiler is using hard or soft floating point ABI])
49 libc_cv_mips_modd_spreg=
51 if test x"$libc_mips_abi" = xo32 -a x"$libc_mips_float" = xhard; then
54 #if !defined(__mips_fpr)
55 #error Missing FPR sizes
59 #if (__mips_fpr != 32)
62 [libc_mips_o32_fp=32],
65 #if (__mips_fpr != 0) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
66 #error Not FPXX (without odd single-precision registers)
68 [libc_mips_o32_fp=xx],
72 #error Not FPXX (with odd single precision registers)
74 [libc_mips_o32_fp=xxo],
77 #if (__mips_fpr != 64) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
80 [libc_mips_o32_fp=64a],
83 #if (__mips_fpr != 64)
86 [libc_mips_o32_fp=64],
90 LIBC_TRY_CC_OPTION([-mfp64], [libc_cv_mips_fp64=yes], [libc_cv_mips_fp64=no])
91 LIBC_TRY_CC_OPTION([-Werror -modd-spreg], [libc_cv_mips_modd_spreg=yes], [libc_cv_mips_modd_spreg=no])
93 LIBC_CONFIG_VAR([o32-fpabi],[${libc_mips_o32_fp}])
94 LIBC_CONFIG_VAR([has-mpf64],[${libc_cv_mips_fp64}])
95 LIBC_CONFIG_VAR([has-modd-spreg],[${libc_cv_mips_modd_spreg}])
99 #include <linux/prctl.h>
100 #if !defined(PR_GET_FP_MODE) || !defined(PR_SET_FP_MODE)
101 #error New prctl support for setting FP modes not found
103 [libc_mips_mode_switch=yes],
104 [libc_mips_mode_switch=no])
105 LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}])
107 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
108 libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
109 #ifdef __mips_nan2008
111 #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
114 if test x"$libc_cv_mips_nan2008" = xyes; then
118 LIBC_CONFIG_VAR([default-abi],
119 [${libc_mips_abi}_${libc_mips_float}${libc_mips_nan}])
123 LIBC_SLIBDIR_RTLDDIR([lib64], [lib64])
126 LIBC_SLIBDIR_RTLDDIR([lib32], [lib32])
130 libc_cv_gcc_unwind_find_fde=yes
132 if test -z "$arch_minimum_kernel"; then
133 if test x$libc_cv_mips_nan2008 = xyes; then
134 arch_minimum_kernel=4.5.0
138 # Check if we are supposed to run on kernels older than 4.8.0. If so,
139 # force executable stack to avoid potential runtime problems with fpu
141 # NOTE: The check below assumes that in absence of user-provided minimum_kernel
142 # we will default to arch_minimum_kernel which is currently less than 4.8.0 for
143 # all known configurations. If this changes, the check must be updated.
144 AC_CACHE_CHECK([whether the compiler must use executable stack],
145 libc_cv_mips_force_execstack, [dnl
146 libc_cv_mips_force_execstack=no
147 if test $libc_mips_float = hard; then
148 if test -n "$minimum_kernel"; then
150 min_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
152 if test $min_version -lt 264192; then
153 libc_cv_mips_force_execstack=yes
156 libc_cv_mips_force_execstack=yes
160 libc_mips_has_gnustack=$libc_cv_as_noexecstack
162 if test $libc_cv_mips_force_execstack = yes; then
163 libc_mips_has_gnustack=no
164 AC_MSG_WARN([forcing executable stack for pre-4.8.0 Linux kernels])
167 LIBC_CONFIG_VAR([mips-force-execstack],[${libc_cv_mips_force_execstack}])
168 LIBC_CONFIG_VAR([mips-has-gnustack],[${libc_mips_has_gnustack}])