S390: Use compile-only instead of also link-tests in configure.

Some of the s390-specific configure checks are using compile and
link configure tests.  Now use only compile tests as the link
tests fails when e.g. bootstrapping a cross-toolchain due to
missing crt-files/libc.so.  This is achieved by using
AC_COMPILE_IFELSE in configure.ac file.

This is observable e.g. when using buildroot which builds glibc
only once or the build-many-glibcs.py script.  Note that the latter
one is building glibc twice in the compilers-step (configure-checks
fails) and in the glibcs-step (configure-checks succeed).

Note, that the s390 specific configure tests for static PIE have to
link an executable to test binutils support.  Thus we can't fix
those tests.
This commit is contained in:
Stefan Liebler 2023-05-12 12:44:49 +02:00
parent 9cc27336c9
commit 368b7c614b
2 changed files with 109 additions and 177 deletions

142
sysdeps/s390/configure vendored
View file

@ -37,12 +37,16 @@ if test "$libc_cv_gcc_builtin_tbegin" = no ; then
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector instruction support" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector instruction support" >&5
$as_echo_n "checking for S390 vector instruction support... " >&6; } $as_echo_n "checking for S390 vector instruction support... " >&6; }
if ${libc_cv_asm_s390_vx+:} false; then : if ${libc_cv_asm_s390_vx+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void testvecinsn () void testvecinsn ()
{ {
__asm__ (".machine \"z13\" \n\t" __asm__ (".machine \"z13\" \n\t"
@ -50,23 +54,17 @@ void testvecinsn ()
"vistrbs %%v16,%%v17 \n\t" "vistrbs %%v16,%%v17 \n\t"
"locghie %%r1,0" : :); "locghie %%r1,0" : :);
} }
EOF
if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null' _ACEOF
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 if ac_fn_c_try_compile "$LINENO"; then :
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_vx=yes libc_cv_asm_s390_vx=yes
else else
libc_cv_asm_s390_vx=no libc_cv_asm_s390_vx=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_vx" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_vx" >&5
$as_echo "$libc_cv_asm_s390_vx" >&6; } $as_echo "$libc_cv_asm_s390_vx" >&6; }
if test "$libc_cv_asm_s390_vx" = yes ; if test "$libc_cv_asm_s390_vx" = yes ;
then then
$as_echo "#define HAVE_S390_VX_ASM_SUPPORT 1" >>confdefs.h $as_echo "#define HAVE_S390_VX_ASM_SUPPORT 1" >>confdefs.h
@ -76,45 +74,47 @@ else
$as_echo "$as_me: WARNING: Use binutils with vector-support in order to use optimized implementations." >&2;} $as_echo "$as_me: WARNING: Use binutils with vector-support in order to use optimized implementations." >&2;}
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector support in gcc" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector support in gcc" >&5
$as_echo_n "checking for S390 vector support in gcc... " >&6; } $as_echo_n "checking for S390 vector support in gcc... " >&6; }
if ${libc_cv_gcc_s390_vx+:} false; then : if ${libc_cv_gcc_s390_vx+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void testvecclobber () void testvecclobber ()
{ {
__asm__ ("" : : : "v16"); __asm__ ("" : : : "v16");
} }
EOF
if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null' _ACEOF
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 if ac_fn_c_try_compile "$LINENO"; then :
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_gcc_s390_vx=yes libc_cv_gcc_s390_vx=yes
else else
libc_cv_gcc_s390_vx=no libc_cv_gcc_s390_vx=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5
$as_echo "$libc_cv_gcc_s390_vx" >&6; } $as_echo "$libc_cv_gcc_s390_vx" >&6; }
if test "$libc_cv_gcc_s390_vx" = yes ; if test "$libc_cv_gcc_s390_vx" = yes ;
then then
$as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support" >&5
$as_echo_n "checking for S390 arch13 zarch instruction support... " >&6; } $as_echo_n "checking for S390 arch13 zarch instruction support... " >&6; }
if ${libc_cv_asm_s390_arch13+:} false; then : if ${libc_cv_asm_s390_arch13+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void testinsn (char *buf) void testinsn (char *buf)
{ {
__asm__ (".machine \"arch13\" \n\t" __asm__ (".machine \"arch13\" \n\t"
@ -124,20 +124,14 @@ void testinsn (char *buf)
"vstrs %%v20,%%v20,%%v20,%%v20,0,2" "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0"); : : "a" (buf) : "memory", "r0");
} }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c _ACEOF
-o conftest.o &> /dev/null' if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_arch13=yes libc_cv_asm_s390_arch13=yes
else else
libc_cv_asm_s390_arch13=no libc_cv_asm_s390_arch13=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_arch13" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_arch13" >&5
$as_echo "$libc_cv_asm_s390_arch13" >&6; } $as_echo "$libc_cv_asm_s390_arch13" >&6; }
@ -153,7 +147,10 @@ $as_echo_n "checking for S390 z10 zarch instruction support as default... " >&6;
if ${libc_cv_asm_s390_min_z10_zarch+:} false; then : if ${libc_cv_asm_s390_min_z10_zarch+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void testinsn (void *a, void *b, int n) void testinsn (void *a, void *b, int n)
{ {
__asm__ ("exrl %2,1f \n\t" __asm__ ("exrl %2,1f \n\t"
@ -163,72 +160,66 @@ void testinsn (void *a, void *b, int n)
: : "a" (a), "a" (b), "d" (n) : : "a" (a), "a" (b), "d" (n)
: "memory", "cc"); : "memory", "cc");
} }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c _ACEOF
-o conftest.o &> /dev/null' if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_min_z10_zarch=yes libc_cv_asm_s390_min_z10_zarch=yes
else else
libc_cv_asm_s390_min_z10_zarch=no libc_cv_asm_s390_min_z10_zarch=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z10_zarch" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z10_zarch" >&5
$as_echo "$libc_cv_asm_s390_min_z10_zarch" >&6; } $as_echo "$libc_cv_asm_s390_min_z10_zarch" >&6; }
if test "$libc_cv_asm_s390_min_z10_zarch" = yes ; if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
then then
$as_echo "#define HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT 1" >>confdefs.h $as_echo "#define HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT 1" >>confdefs.h
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5
$as_echo_n "checking for S390 z196 zarch instruction support as default... " >&6; } $as_echo_n "checking for S390 z196 zarch instruction support as default... " >&6; }
if ${libc_cv_asm_s390_min_z196_zarch+:} false; then : if ${libc_cv_asm_s390_min_z196_zarch+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
float testinsn (double e) float testinsn (double e)
{ {
float d; float d;
__asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) ); __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
return d; return d;
} }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c _ACEOF
-o conftest.o &> /dev/null' if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_min_z196_zarch=yes libc_cv_asm_s390_min_z196_zarch=yes
else else
libc_cv_asm_s390_min_z196_zarch=no libc_cv_asm_s390_min_z196_zarch=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z196_zarch" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z196_zarch" >&5
$as_echo "$libc_cv_asm_s390_min_z196_zarch" >&6; } $as_echo "$libc_cv_asm_s390_min_z196_zarch" >&6; }
if test "$libc_cv_asm_s390_min_z196_zarch" = yes ; if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
then then
$as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h $as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z13 zarch instruction support as default" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z13 zarch instruction support as default" >&5
$as_echo_n "checking for S390 z13 zarch instruction support as default... " >&6; } $as_echo_n "checking for S390 z13 zarch instruction support as default... " >&6; }
if ${libc_cv_asm_s390_min_z13_zarch+:} false; then : if ${libc_cv_asm_s390_min_z13_zarch+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int testinsn (void) int testinsn (void)
{ {
int i; int i;
@ -237,36 +228,33 @@ int testinsn (void)
: "=d" (i) : : "memory", "v16"); : "=d" (i) : : "memory", "v16");
return i; return i;
} }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c _ACEOF
-o conftest.o &> /dev/null' if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_min_z13_zarch=yes libc_cv_asm_s390_min_z13_zarch=yes
else else
libc_cv_asm_s390_min_z13_zarch=no libc_cv_asm_s390_min_z13_zarch=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z13_zarch" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z13_zarch" >&5
$as_echo "$libc_cv_asm_s390_min_z13_zarch" >&6; } $as_echo "$libc_cv_asm_s390_min_z13_zarch" >&6; }
if test "$libc_cv_asm_s390_min_z13_zarch" = yes ; if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
then then
$as_echo "#define HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT 1" >>confdefs.h $as_echo "#define HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT 1" >>confdefs.h
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support as default" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support as default" >&5
$as_echo_n "checking for S390 arch13 zarch instruction support as default... " >&6; } $as_echo_n "checking for S390 arch13 zarch instruction support as default... " >&6; }
if ${libc_cv_asm_s390_min_arch13_zarch+:} false; then : if ${libc_cv_asm_s390_min_arch13_zarch+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat > conftest.c <<\EOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void testinsn (char *buf) void testinsn (char *buf)
{ {
__asm__ ("lghi %%r0,16 \n\t" __asm__ ("lghi %%r0,16 \n\t"
@ -274,20 +262,14 @@ void testinsn (char *buf)
"vstrs %%v20,%%v20,%%v20,%%v20,0,2" "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0"); : : "a" (buf) : "memory", "r0");
} }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c _ACEOF
-o conftest.o &> /dev/null' if ac_fn_c_try_compile "$LINENO"; then :
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } ;
then
libc_cv_asm_s390_min_arch13_zarch=yes libc_cv_asm_s390_min_arch13_zarch=yes
else else
libc_cv_asm_s390_min_arch13_zarch=no libc_cv_asm_s390_min_arch13_zarch=no
fi fi
rm -f conftest* rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_arch13_zarch" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_arch13_zarch" >&5
$as_echo "$libc_cv_asm_s390_min_arch13_zarch" >&6; } $as_echo "$libc_cv_asm_s390_min_arch13_zarch" >&6; }

View file

@ -27,8 +27,8 @@ if test "$libc_cv_gcc_builtin_tbegin" = no ; then
fi fi
AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl AC_CACHE_CHECK([for S390 vector instruction support], libc_cv_asm_s390_vx, [
cat > conftest.c <<\EOF AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testvecinsn () void testvecinsn ()
{ {
__asm__ (".machine \"z13\" \n\t" __asm__ (".machine \"z13\" \n\t"
@ -36,17 +36,9 @@ void testvecinsn ()
"vistrbs %%v16,%%v17 \n\t" "vistrbs %%v16,%%v17 \n\t"
"locghie %%r1,0" : :); "locghie %%r1,0" : :);
} }
EOF ]])],
dnl [libc_cv_asm_s390_vx=yes],
dnl test, if assembler supports S390 vector instructions [libc_cv_asm_s390_vx=no])])
if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_vx=yes
else
libc_cv_asm_s390_vx=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_vx" = yes ; if test "$libc_cv_asm_s390_vx" = yes ;
then then
AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT) AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
@ -54,31 +46,26 @@ else
AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.]) AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
fi fi
AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
cat > conftest.c <<\EOF dnl test, if gcc supports S390 vector registers as clobber in inline assembly
AC_CACHE_CHECK([for S390 vector support in gcc], libc_cv_gcc_s390_vx, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testvecclobber () void testvecclobber ()
{ {
__asm__ ("" : : : "v16"); __asm__ ("" : : : "v16");
} }
EOF ]])],
dnl [libc_cv_gcc_s390_vx=yes],
dnl test, if gcc supports S390 vector registers as clobber in inline assembly [libc_cv_gcc_s390_vx=no])])
if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
then
libc_cv_gcc_s390_vx=yes
else
libc_cv_gcc_s390_vx=no
fi
rm -f conftest* ])
if test "$libc_cv_gcc_s390_vx" = yes ; if test "$libc_cv_gcc_s390_vx" = yes ;
then then
AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT) AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
fi fi
AC_CACHE_CHECK(for S390 arch13 zarch instruction support,
libc_cv_asm_s390_arch13, [dnl AC_CACHE_CHECK([for S390 arch13 zarch instruction support],
cat > conftest.c <<\EOF libc_cv_asm_s390_arch13, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (char *buf) void testinsn (char *buf)
{ {
__asm__ (".machine \"arch13\" \n\t" __asm__ (".machine \"arch13\" \n\t"
@ -88,25 +75,18 @@ void testinsn (char *buf)
"vstrs %%v20,%%v20,%%v20,%%v20,0,2" "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0"); : : "a" (buf) : "memory", "r0");
} }
EOF ]])],
dnl test, if assembler supports S390 arch13 instructions [libc_cv_asm_s390_arch13=yes],
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c [libc_cv_asm_s390_arch13=no])])
-o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_arch13=yes
else
libc_cv_asm_s390_arch13=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_arch13" = yes ; if test "$libc_cv_asm_s390_arch13" = yes ;
then then
AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT) AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT)
fi fi
AC_CACHE_CHECK(for S390 z10 zarch instruction support as default, AC_CACHE_CHECK([for S390 z10 zarch instruction support as default],
libc_cv_asm_s390_min_z10_zarch, [dnl libc_cv_asm_s390_min_z10_zarch, [
cat > conftest.c <<\EOF AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (void *a, void *b, int n) void testinsn (void *a, void *b, int n)
{ {
__asm__ ("exrl %2,1f \n\t" __asm__ ("exrl %2,1f \n\t"
@ -116,52 +96,36 @@ void testinsn (void *a, void *b, int n)
: : "a" (a), "a" (b), "d" (n) : : "a" (a), "a" (b), "d" (n)
: "memory", "cc"); : "memory", "cc");
} }
EOF ]])],
dnl [libc_cv_asm_s390_min_z10_zarch=yes],
dnl test, if assembler supports S390 z10 zarch instructions as default [libc_cv_asm_s390_min_z10_zarch=no])])
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
-o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_min_z10_zarch=yes
else
libc_cv_asm_s390_min_z10_zarch=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_min_z10_zarch" = yes ; if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
then then
AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT) AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT)
fi fi
AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
libc_cv_asm_s390_min_z196_zarch, [dnl AC_CACHE_CHECK([for S390 z196 zarch instruction support as default],
cat > conftest.c <<\EOF libc_cv_asm_s390_min_z196_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
float testinsn (double e) float testinsn (double e)
{ {
float d; float d;
__asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) ); __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
return d; return d;
} }
EOF ]])],
dnl [libc_cv_asm_s390_min_z196_zarch=yes],
dnl test, if assembler supports S390 z196 zarch instructions as default [libc_cv_asm_s390_min_z196_zarch=no])])
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
-o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_min_z196_zarch=yes
else
libc_cv_asm_s390_min_z196_zarch=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_min_z196_zarch" = yes ; if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
then then
AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT) AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
fi fi
AC_CACHE_CHECK(for S390 z13 zarch instruction support as default,
libc_cv_asm_s390_min_z13_zarch, [dnl AC_CACHE_CHECK([for S390 z13 zarch instruction support as default],
cat > conftest.c <<\EOF libc_cv_asm_s390_min_z13_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int testinsn (void) int testinsn (void)
{ {
int i; int i;
@ -170,26 +134,18 @@ int testinsn (void)
: "=d" (i) : : "memory", "v16"); : "=d" (i) : : "memory", "v16");
return i; return i;
} }
EOF ]])],
dnl [libc_cv_asm_s390_min_z13_zarch=yes],
dnl test, if assembler supports S390 z13 zarch instructions as default [libc_cv_asm_s390_min_z13_zarch=no])])
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
-o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_min_z13_zarch=yes
else
libc_cv_asm_s390_min_z13_zarch=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_min_z13_zarch" = yes ; if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
then then
AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT) AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT)
fi fi
AC_CACHE_CHECK(for S390 arch13 zarch instruction support as default,
libc_cv_asm_s390_min_arch13_zarch, [dnl AC_CACHE_CHECK([for S390 arch13 zarch instruction support as default],
cat > conftest.c <<\EOF libc_cv_asm_s390_min_arch13_zarch, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
void testinsn (char *buf) void testinsn (char *buf)
{ {
__asm__ ("lghi %%r0,16 \n\t" __asm__ ("lghi %%r0,16 \n\t"
@ -197,21 +153,15 @@ void testinsn (char *buf)
"vstrs %%v20,%%v20,%%v20,%%v20,0,2" "vstrs %%v20,%%v20,%%v20,%%v20,0,2"
: : "a" (buf) : "memory", "r0"); : : "a" (buf) : "memory", "r0");
} }
EOF ]])],
dnl test, if assembler supports S390 arch13 zarch instructions as default [libc_cv_asm_s390_min_arch13_zarch=yes],
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c [libc_cv_asm_s390_min_arch13_zarch=no])])
-o conftest.o &> /dev/null]) ;
then
libc_cv_asm_s390_min_arch13_zarch=yes
else
libc_cv_asm_s390_min_arch13_zarch=no
fi
rm -f conftest* ])
if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ; if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ;
then then
AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT) AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT)
fi fi
dnl test if GCC is new enough. See gcc "Bug 98269 - gcc 6.5.0 dnl test if GCC is new enough. See gcc "Bug 98269 - gcc 6.5.0
dnl __builtin_add_overflow() with small uint32_t values incorrectly detects dnl __builtin_add_overflow() with small uint32_t values incorrectly detects
dnl overflow dnl overflow