From patchwork Fri May 12 10:44:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1780488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=fMbULs/U; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QHlmG5ZQSz20KG for ; Fri, 12 May 2023 20:45:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C50063856244 for ; Fri, 12 May 2023 10:45:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C50063856244 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683888348; bh=XbMSh7R5sde08gO8egcW+ypOgfNPRtp9RgiZhIIZ340=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=fMbULs/UomDx9kwCKTcqsqv571LfQHK/1qfP6WWpV7tuCMKtdmZ48vzBVJjD5IqFt DIrnCBjWxzljNhpdd3nnk4miT0NpouRFUWULinQ1fbGP7ROv4AyojNZPBeHA4KHkjb GBypvHanEbhmAm3FTwMdS9GyayWy8BNCh2jAKLWg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 1047A3858C54 for ; Fri, 12 May 2023 10:45:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1047A3858C54 Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34CAcAt8014684; Fri, 12 May 2023 10:45:31 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qhkg993ab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2023 10:45:30 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34C48cqD025905; Fri, 12 May 2023 10:45:28 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3qf896t9q9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2023 10:45:28 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34CAjO4043712990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 May 2023 10:45:25 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5F5E2005A; Fri, 12 May 2023 10:45:24 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8734D2004B; Fri, 12 May 2023 10:45:24 +0000 (GMT) Received: from a35lp68.lnxne.boe (unknown [9.152.108.100]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 12 May 2023 10:45:24 +0000 (GMT) To: libc-alpha@sourceware.org Cc: Andreas Schwab , Stefan Liebler Subject: [PATCH v2] S390: Use compile-only instead of also link-tests in configure. Date: Fri, 12 May 2023 12:44:49 +0200 Message-Id: <20230512104449.2060235-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: IbHFPD8ldFbZdtXNlf4adbHCg7foxJ9I X-Proofpoint-GUID: IbHFPD8ldFbZdtXNlf4adbHCg7foxJ9I X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-12_07,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 clxscore=1011 priorityscore=1501 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305120088 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stefan Liebler via Libc-alpha From: Stefan Liebler Reply-To: Stefan Liebler Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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. --- sysdeps/s390/configure | 142 ++++++++++++++++--------------------- sysdeps/s390/configure.ac | 144 +++++++++++++------------------------- 2 files changed, 109 insertions(+), 177 deletions(-) diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index cc68cbbb03..6a13c9c7bd 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -37,12 +37,16 @@ if test "$libc_cv_gcc_builtin_tbegin" = no ; then fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector instruction support" >&5 $as_echo_n "checking for S390 vector instruction support... " >&6; } if ${libc_cv_asm_s390_vx+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + void testvecinsn () { __asm__ (".machine \"z13\" \n\t" @@ -50,23 +54,17 @@ void testvecinsn () "vistrbs %%v16,%%v17 \n\t" "locghie %%r1,0" : :); } -EOF -if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_vx=yes else libc_cv_asm_s390_vx=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_vx" >&5 $as_echo "$libc_cv_asm_s390_vx" >&6; } - if test "$libc_cv_asm_s390_vx" = yes ; then $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;} fi + { $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; } if ${libc_cv_gcc_s390_vx+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + void testvecclobber () { __asm__ ("" : : : "v16"); } -EOF -if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_gcc_s390_vx=yes else libc_cv_gcc_s390_vx=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5 $as_echo "$libc_cv_gcc_s390_vx" >&6; } - if test "$libc_cv_gcc_s390_vx" = yes ; then $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h fi + { $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; } if ${libc_cv_asm_s390_arch13+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + void testinsn (char *buf) { __asm__ (".machine \"arch13\" \n\t" @@ -124,20 +124,14 @@ void testinsn (char *buf) "vstrs %%v20,%%v20,%%v20,%%v20,0,2" : : "a" (buf) : "memory", "r0"); } -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_arch13=yes else libc_cv_asm_s390_arch13=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_arch13" >&5 $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 : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + void testinsn (void *a, void *b, int n) { __asm__ ("exrl %2,1f \n\t" @@ -163,72 +160,66 @@ void testinsn (void *a, void *b, int n) : : "a" (a), "a" (b), "d" (n) : "memory", "cc"); } -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_min_z10_zarch=yes else libc_cv_asm_s390_min_z10_zarch=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $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; } - if test "$libc_cv_asm_s390_min_z10_zarch" = yes ; then $as_echo "#define HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT 1" >>confdefs.h fi + { $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; } if ${libc_cv_asm_s390_min_z196_zarch+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + float testinsn (double e) { float d; __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) ); return d; } -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_min_z196_zarch=yes else libc_cv_asm_s390_min_z196_zarch=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $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; } - if test "$libc_cv_asm_s390_min_z196_zarch" = yes ; then $as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h fi + { $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; } if ${libc_cv_asm_s390_min_z13_zarch+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + int testinsn (void) { int i; @@ -237,36 +228,33 @@ int testinsn (void) : "=d" (i) : : "memory", "v16"); return i; } -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_min_z13_zarch=yes else libc_cv_asm_s390_min_z13_zarch=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $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; } - if test "$libc_cv_asm_s390_min_z13_zarch" = yes ; then $as_echo "#define HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT 1" >>confdefs.h fi + { $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; } if ${libc_cv_asm_s390_min_arch13_zarch+:} false; then : $as_echo_n "(cached) " >&6 else - cat > conftest.c <<\EOF + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + void testinsn (char *buf) { __asm__ ("lghi %%r0,16 \n\t" @@ -274,20 +262,14 @@ void testinsn (char *buf) "vstrs %%v20,%%v20,%%v20,%%v20,0,2" : : "a" (buf) : "memory", "r0"); } -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null' - { { 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 + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : libc_cv_asm_s390_min_arch13_zarch=yes else libc_cv_asm_s390_min_arch13_zarch=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $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; } diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac index daf1bc6823..89c3e5b211 100644 --- a/sysdeps/s390/configure.ac +++ b/sysdeps/s390/configure.ac @@ -27,8 +27,8 @@ if test "$libc_cv_gcc_builtin_tbegin" = no ; then fi -AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl -cat > conftest.c <<\EOF +AC_CACHE_CHECK([for S390 vector instruction support], libc_cv_asm_s390_vx, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ void testvecinsn () { __asm__ (".machine \"z13\" \n\t" @@ -36,17 +36,9 @@ void testvecinsn () "vistrbs %%v16,%%v17 \n\t" "locghie %%r1,0" : :); } -EOF -dnl -dnl test, if assembler supports S390 vector instructions -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* ]) - +]])], + [libc_cv_asm_s390_vx=yes], + [libc_cv_asm_s390_vx=no])]) if test "$libc_cv_asm_s390_vx" = yes ; then 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.]) 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 () { __asm__ ("" : : : "v16"); } -EOF -dnl -dnl test, if gcc supports S390 vector registers as clobber in inline assembly -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* ]) - +]])], + [libc_cv_gcc_s390_vx=yes], + [libc_cv_gcc_s390_vx=no])]) if test "$libc_cv_gcc_s390_vx" = yes ; then AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT) fi -AC_CACHE_CHECK(for S390 arch13 zarch instruction support, - libc_cv_asm_s390_arch13, [dnl -cat > conftest.c <<\EOF + +AC_CACHE_CHECK([for S390 arch13 zarch instruction support], + libc_cv_asm_s390_arch13, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ void testinsn (char *buf) { __asm__ (".machine \"arch13\" \n\t" @@ -88,25 +75,18 @@ void testinsn (char *buf) "vstrs %%v20,%%v20,%%v20,%%v20,0,2" : : "a" (buf) : "memory", "r0"); } -EOF -dnl test, if assembler supports S390 arch13 instructions -if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -o conftest.o &> /dev/null]) ; -then - libc_cv_asm_s390_arch13=yes -else - libc_cv_asm_s390_arch13=no -fi -rm -f conftest* ]) +]])], + [libc_cv_asm_s390_arch13=yes], + [libc_cv_asm_s390_arch13=no])]) if test "$libc_cv_asm_s390_arch13" = yes ; then AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT) fi -AC_CACHE_CHECK(for S390 z10 zarch instruction support as default, - libc_cv_asm_s390_min_z10_zarch, [dnl -cat > conftest.c <<\EOF +AC_CACHE_CHECK([for S390 z10 zarch instruction support as default], + libc_cv_asm_s390_min_z10_zarch, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ void testinsn (void *a, void *b, int n) { __asm__ ("exrl %2,1f \n\t" @@ -116,52 +96,36 @@ void testinsn (void *a, void *b, int n) : : "a" (a), "a" (b), "d" (n) : "memory", "cc"); } -EOF -dnl -dnl test, if assembler supports S390 z10 zarch instructions as default -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* ]) - +]])], + [libc_cv_asm_s390_min_z10_zarch=yes], + [libc_cv_asm_s390_min_z10_zarch=no])]) if test "$libc_cv_asm_s390_min_z10_zarch" = yes ; then AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT) fi -AC_CACHE_CHECK(for S390 z196 zarch instruction support as default, - libc_cv_asm_s390_min_z196_zarch, [dnl -cat > conftest.c <<\EOF + +AC_CACHE_CHECK([for S390 z196 zarch instruction support as default], + libc_cv_asm_s390_min_z196_zarch, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ float testinsn (double e) { float d; __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) ); return d; } -EOF -dnl -dnl test, if assembler supports S390 z196 zarch instructions as default -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* ]) - +]])], + [libc_cv_asm_s390_min_z196_zarch=yes], + [libc_cv_asm_s390_min_z196_zarch=no])]) if test "$libc_cv_asm_s390_min_z196_zarch" = yes ; then AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT) fi -AC_CACHE_CHECK(for S390 z13 zarch instruction support as default, - libc_cv_asm_s390_min_z13_zarch, [dnl -cat > conftest.c <<\EOF + +AC_CACHE_CHECK([for S390 z13 zarch instruction support as default], + libc_cv_asm_s390_min_z13_zarch, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ int testinsn (void) { int i; @@ -170,26 +134,18 @@ int testinsn (void) : "=d" (i) : : "memory", "v16"); return i; } -EOF -dnl -dnl test, if assembler supports S390 z13 zarch instructions as default -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* ]) - +]])], + [libc_cv_asm_s390_min_z13_zarch=yes], + [libc_cv_asm_s390_min_z13_zarch=no])]) if test "$libc_cv_asm_s390_min_z13_zarch" = yes ; then AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT) fi -AC_CACHE_CHECK(for S390 arch13 zarch instruction support as default, - libc_cv_asm_s390_min_arch13_zarch, [dnl -cat > conftest.c <<\EOF + +AC_CACHE_CHECK([for S390 arch13 zarch instruction support as default], + libc_cv_asm_s390_min_arch13_zarch, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ void testinsn (char *buf) { __asm__ ("lghi %%r0,16 \n\t" @@ -197,21 +153,15 @@ void testinsn (char *buf) "vstrs %%v20,%%v20,%%v20,%%v20,0,2" : : "a" (buf) : "memory", "r0"); } -EOF -dnl test, if assembler supports S390 arch13 zarch instructions as default -if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c - -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* ]) +]])], + [libc_cv_asm_s390_min_arch13_zarch=yes], + [libc_cv_asm_s390_min_arch13_zarch=no])]) if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ; then AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT) fi + 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 overflow