S390: Use compile-only instead of also link-tests in configure.
[glibc.git] / sysdeps / s390 / configure
blob6a13c9c7bd44b7013701ab57fd02a88717ecba61
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/s390.
4 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_tbegin" >&5
5 $as_echo_n "checking for __builtin_tbegin... " >&6; }
6 if ${libc_cv_gcc_builtin_tbegin+:} false; then :
7   $as_echo_n "(cached) " >&6
8 else
9   cat > conftest.c <<\EOF
10 #include <htmintrin.h>
11 void testtransaction ()
13   if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED)
14     {
15       __builtin_tend ();
16     }
18 EOF
19 if { ac_try='${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null'
20   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
21   (eval $ac_try) 2>&5
22   ac_status=$?
23   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
24   test $ac_status = 0; }; } ;
25 then
26   libc_cv_gcc_builtin_tbegin=yes
27 else
28   libc_cv_gcc_builtin_tbegin=no
30 rm -f conftest*
32 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_builtin_tbegin" >&5
33 $as_echo "$libc_cv_gcc_builtin_tbegin" >&6; }
35 if test "$libc_cv_gcc_builtin_tbegin" = no ; then
36    critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
41 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector instruction support" >&5
42 $as_echo_n "checking for S390 vector instruction support... " >&6; }
43 if ${libc_cv_asm_s390_vx+:} false; then :
44   $as_echo_n "(cached) " >&6
45 else
47 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48 /* end confdefs.h.  */
50 void testvecinsn ()
52     __asm__ (".machine \"z13\" \n\t"
53              ".machinemode \"zarch_nohighgprs\" \n\t"
54              "vistrbs %%v16,%%v17 \n\t"
55              "locghie %%r1,0" : :);
58 _ACEOF
59 if ac_fn_c_try_compile "$LINENO"; then :
60   libc_cv_asm_s390_vx=yes
61 else
62   libc_cv_asm_s390_vx=no
64 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_vx" >&5
67 $as_echo "$libc_cv_asm_s390_vx" >&6; }
68 if test "$libc_cv_asm_s390_vx" = yes ;
69 then
70   $as_echo "#define HAVE_S390_VX_ASM_SUPPORT 1" >>confdefs.h
72 else
73   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use binutils with vector-support in order to use optimized implementations." >&5
74 $as_echo "$as_me: WARNING: Use binutils with vector-support in order to use optimized implementations." >&2;}
78 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector support in gcc" >&5
79 $as_echo_n "checking for S390 vector support in gcc... " >&6; }
80 if ${libc_cv_gcc_s390_vx+:} false; then :
81   $as_echo_n "(cached) " >&6
82 else
84 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
85 /* end confdefs.h.  */
87 void testvecclobber ()
89   __asm__ ("" : : : "v16");
92 _ACEOF
93 if ac_fn_c_try_compile "$LINENO"; then :
94   libc_cv_gcc_s390_vx=yes
95 else
96   libc_cv_gcc_s390_vx=no
98 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
100 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5
101 $as_echo "$libc_cv_gcc_s390_vx" >&6; }
102 if test "$libc_cv_gcc_s390_vx" = yes ;
103 then
104   $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h
109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support" >&5
110 $as_echo_n "checking for S390 arch13 zarch instruction support... " >&6; }
111 if ${libc_cv_asm_s390_arch13+:} false; then :
112   $as_echo_n "(cached) " >&6
113 else
115 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
116 /* end confdefs.h.  */
118 void testinsn (char *buf)
120     __asm__ (".machine \"arch13\" \n\t"
121              ".machinemode \"zarch_nohighgprs\" \n\t"
122              "lghi %%r0,16 \n\t"
123              "mvcrl 0(%0),32(%0) \n\t"
124              "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
125              : : "a" (buf) : "memory", "r0");
128 _ACEOF
129 if ac_fn_c_try_compile "$LINENO"; then :
130   libc_cv_asm_s390_arch13=yes
131 else
132   libc_cv_asm_s390_arch13=no
134 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
136 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_arch13" >&5
137 $as_echo "$libc_cv_asm_s390_arch13" >&6; }
138 if test "$libc_cv_asm_s390_arch13" = yes ;
139 then
140   $as_echo "#define HAVE_S390_ARCH13_ASM_SUPPORT 1" >>confdefs.h
145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z10 zarch instruction support as default" >&5
146 $as_echo_n "checking for S390 z10 zarch instruction support as default... " >&6; }
147 if ${libc_cv_asm_s390_min_z10_zarch+:} false; then :
148   $as_echo_n "(cached) " >&6
149 else
151 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
152 /* end confdefs.h.  */
154 void testinsn (void *a, void *b, int n)
156     __asm__ ("exrl %2,1f \n\t"
157              "j 2f \n\t"
158              "1: mvc 0(1,%0),0(%1) \n\t"
159              "2:"
160              : : "a" (a), "a" (b), "d" (n)
161              : "memory", "cc");
164 _ACEOF
165 if ac_fn_c_try_compile "$LINENO"; then :
166   libc_cv_asm_s390_min_z10_zarch=yes
167 else
168   libc_cv_asm_s390_min_z10_zarch=no
170 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
172 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z10_zarch" >&5
173 $as_echo "$libc_cv_asm_s390_min_z10_zarch" >&6; }
174 if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
175 then
176   $as_echo "#define HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT 1" >>confdefs.h
181 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5
182 $as_echo_n "checking for S390 z196 zarch instruction support as default... " >&6; }
183 if ${libc_cv_asm_s390_min_z196_zarch+:} false; then :
184   $as_echo_n "(cached) " >&6
185 else
187 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
188 /* end confdefs.h.  */
190 float testinsn (double e)
192     float d;
193     __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
194     return d;
197 _ACEOF
198 if ac_fn_c_try_compile "$LINENO"; then :
199   libc_cv_asm_s390_min_z196_zarch=yes
200 else
201   libc_cv_asm_s390_min_z196_zarch=no
203 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
205 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z196_zarch" >&5
206 $as_echo "$libc_cv_asm_s390_min_z196_zarch" >&6; }
207 if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
208 then
209   $as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h
214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z13 zarch instruction support as default" >&5
215 $as_echo_n "checking for S390 z13 zarch instruction support as default... " >&6; }
216 if ${libc_cv_asm_s390_min_z13_zarch+:} false; then :
217   $as_echo_n "(cached) " >&6
218 else
220 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
221 /* end confdefs.h.  */
223 int testinsn (void)
225     int i;
226     __asm__ ("vl %%v16,0(%%r15)\n\t"
227              "vlgvf %0,%%v16,0"
228              : "=d" (i) : : "memory", "v16");
229     return i;
232 _ACEOF
233 if ac_fn_c_try_compile "$LINENO"; then :
234   libc_cv_asm_s390_min_z13_zarch=yes
235 else
236   libc_cv_asm_s390_min_z13_zarch=no
238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z13_zarch" >&5
241 $as_echo "$libc_cv_asm_s390_min_z13_zarch" >&6; }
242 if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
243 then
244   $as_echo "#define HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT 1" >>confdefs.h
249 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support as default" >&5
250 $as_echo_n "checking for S390 arch13 zarch instruction support as default... " >&6; }
251 if ${libc_cv_asm_s390_min_arch13_zarch+:} false; then :
252   $as_echo_n "(cached) " >&6
253 else
255 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
256 /* end confdefs.h.  */
258 void testinsn (char *buf)
260     __asm__ ("lghi %%r0,16 \n\t"
261              "mvcrl 0(%0),32(%0) \n\t"
262              "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
263              : : "a" (buf) : "memory", "r0");
266 _ACEOF
267 if ac_fn_c_try_compile "$LINENO"; then :
268   libc_cv_asm_s390_min_arch13_zarch=yes
269 else
270   libc_cv_asm_s390_min_arch13_zarch=no
272 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
274 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_arch13_zarch" >&5
275 $as_echo "$libc_cv_asm_s390_min_arch13_zarch" >&6; }
276 if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ;
277 then
278   $as_echo "#define HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT 1" >>confdefs.h
284 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc on s390x" >&5
285 $as_echo_n "checking if $CC is sufficient to build libc on s390x... " >&6; }
286 if ${libc_cv_compiler_ok_on_s390x+:} false; then :
287   $as_echo_n "(cached) " >&6
288 else
290 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
291 /* end confdefs.h.  */
294 main ()
297 #if !defined __GNUC__ || __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 1)
298 #error insufficient compiler for building on s390x
299 #endif
301   ;
302   return 0;
304 _ACEOF
305 if ac_fn_c_try_cpp "$LINENO"; then :
306   libc_cv_compiler_ok_on_s390x=yes
307 else
308   libc_cv_compiler_ok_on_s390x=no
310 rm -f conftest.err conftest.i conftest.$ac_ext
312 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok_on_s390x" >&5
313 $as_echo "$libc_cv_compiler_ok_on_s390x" >&6; }
314 if test "$libc_cv_compiler_ok_on_s390x" != yes; then
315    critic_missing="$critic_missing On s390x, GCC >= 7.1.0 is required."
318 test -n "$critic_missing" && as_fn_error $? "
319 *** $critic_missing" "$LINENO" 5