public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] S390: Use compile-only instead of also link-tests in configure.
@ 2023-05-10 11:25 Stefan Liebler
  2023-05-10 11:47 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Liebler @ 2023-05-10 11:25 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stefan Liebler

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 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    | 14 +++++++-------
 sysdeps/s390/configure.ac | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index cc68cbbb03..894fe3b594 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -51,7 +51,7 @@ void testvecinsn ()
 	     "locghie %%r1,0" : :);
 }
 EOF
-if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null'
+if { ac_try='${CC-cc} -c --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=$?
@@ -87,7 +87,7 @@ void testvecclobber ()
   __asm__ ("" : : : "v16");
 }
 EOF
-if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null'
+if { ac_try='${CC-cc} -c --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=$?
@@ -125,7 +125,7 @@ void testinsn (char *buf)
 	     : : "a" (buf) : "memory", "r0");
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -164,7 +164,7 @@ void testinsn (void *a, void *b, int n)
 	     : "memory", "cc");
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -200,7 +200,7 @@ float testinsn (double e)
     return d;
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -238,7 +238,7 @@ int testinsn (void)
     return i;
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -275,7 +275,7 @@ void testinsn (char *buf)
 	     : : "a" (buf) : "memory", "r0");
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index daf1bc6823..02c0f66c76 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -39,7 +39,7 @@ void testvecinsn ()
 EOF
 dnl
 dnl test, if assembler supports S390 vector instructions
-if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
+if AC_TRY_COMMAND([${CC-cc} -c --shared conftest.c -o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_vx=yes
 else
@@ -63,7 +63,7 @@ void testvecclobber ()
 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]) ;
+if AC_TRY_COMMAND([${CC-cc} -c --shared conftest.c -o conftest.o &> /dev/null]) ;
 then
   libc_cv_gcc_s390_vx=yes
 else
@@ -90,7 +90,7 @@ void testinsn (char *buf)
 }
 EOF
 dnl test, if assembler supports S390 arch13 instructions
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_arch13=yes
@@ -119,7 +119,7 @@ void testinsn (void *a, void *b, int n)
 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
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_min_z10_zarch=yes
@@ -145,7 +145,7 @@ float testinsn (double e)
 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
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_min_z196_zarch=yes
@@ -173,7 +173,7 @@ int testinsn (void)
 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
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_min_z13_zarch=yes
@@ -199,7 +199,7 @@ void testinsn (char *buf)
 }
 EOF
 dnl test, if assembler supports S390 arch13 zarch instructions as default
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -c --shared conftest.c
 			-o conftest.o &> /dev/null]) ;
 then
   libc_cv_asm_s390_min_arch13_zarch=yes
-- 
2.39.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] S390: Use compile-only instead of also link-tests in configure.
  2023-05-10 11:25 [PATCH] S390: Use compile-only instead of also link-tests in configure Stefan Liebler
@ 2023-05-10 11:47 ` Andreas Schwab
  2023-05-12 10:47   ` Stefan Liebler
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2023-05-10 11:47 UTC (permalink / raw)
  To: Stefan Liebler via Libc-alpha; +Cc: Stefan Liebler

On Mai 10 2023, Stefan Liebler via Libc-alpha wrote:

> diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
> index daf1bc6823..02c0f66c76 100644
> --- a/sysdeps/s390/configure.ac
> +++ b/sysdeps/s390/configure.ac
> @@ -39,7 +39,7 @@ void testvecinsn ()
>  EOF
>  dnl
>  dnl test, if assembler supports S390 vector instructions
> -if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
> +if AC_TRY_COMMAND([${CC-cc} -c --shared conftest.c -o conftest.o &> /dev/null]) ;

--shared is only a linker option.  Can this use AC_COMPILE_IFELSE instead?

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] S390: Use compile-only instead of also link-tests in configure.
  2023-05-10 11:47 ` Andreas Schwab
@ 2023-05-12 10:47   ` Stefan Liebler
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2023-05-12 10:47 UTC (permalink / raw)
  To: Andreas Schwab, Stefan Liebler via Libc-alpha

On 10.05.23 13:47, Andreas Schwab wrote:
> On Mai 10 2023, Stefan Liebler via Libc-alpha wrote:
> 
>> diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
>> index daf1bc6823..02c0f66c76 100644
>> --- a/sysdeps/s390/configure.ac
>> +++ b/sysdeps/s390/configure.ac
>> @@ -39,7 +39,7 @@ void testvecinsn ()
>>  EOF
>>  dnl
>>  dnl test, if assembler supports S390 vector instructions
>> -if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
>> +if AC_TRY_COMMAND([${CC-cc} -c --shared conftest.c -o conftest.o &> /dev/null]) ;
> 
> --shared is only a linker option.  Can this use AC_COMPILE_IFELSE instead?
> 
Hi Andreas,

yes, AC_COMPILE_IFELSE is fine. I've just posted v2:
"[PATCH v2] S390: Use compile-only instead of also link-tests in configure."
https://sourceware.org/pipermail/libc-alpha/2023-May/148028.html
Can you please have a look?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-12 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 11:25 [PATCH] S390: Use compile-only instead of also link-tests in configure Stefan Liebler
2023-05-10 11:47 ` Andreas Schwab
2023-05-12 10:47   ` Stefan Liebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).