public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3] s390x: Capture grep output in static PIE check
@ 2024-06-20 12:38 Florian Weimer
  2024-06-20 13:02 ` Sam James
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2024-06-20 12:38 UTC (permalink / raw)
  To: libc-alpha; +Cc: Sam James

The test is not a run-time check, so update the description.
Also use readelf -W for a more stable output format and fix
an LC_ALL typo.

This avoids garbled configure messages:

checking for s390-specific static PIE requirements (runtime check)...  0x0000000000000017 (JMPREL)             0x280
yes

---
v3: Fix LC_ALL typo.
 sysdeps/s390/s390-64/configure    | 8 ++++----
 sysdeps/s390/s390-64/configure.ac | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sysdeps/s390/s390-64/configure b/sysdeps/s390/s390-64/configure
index 33c28614c2..9ea6940c85 100644
--- a/sysdeps/s390/s390-64/configure
+++ b/sysdeps/s390/s390-64/configure
@@ -4,8 +4,8 @@
 # Minimal checking for static PIE support in ld.
 # Compare to ld testcase/bugzilla:
 # <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements (runtime check)" >&5
-printf %s "checking for s390-specific static PIE requirements (runtime check)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements" >&5
+printf %s "checking for s390-specific static PIE requirements... " >&6; }
 if { as_var=\
 libc_cv_s390x_staticpie_req_runtime; eval test \${$as_var+y}; }
 then :
@@ -62,13 +62,13 @@ EOF
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; } \
-     && { ac_try='! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF'
+     && { ac_try='! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF >&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; } \
-     && { ac_try='LC_ACLL=C $READELF -d conftest | grep JMPREL'
+     && { ac_try='LC_ALL=C $READELF -Wd conftest | grep JMPREL >&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
diff --git a/sysdeps/s390/s390-64/configure.ac b/sysdeps/s390/s390-64/configure.ac
index fd729e1496..aaf71eabb1 100644
--- a/sysdeps/s390/s390-64/configure.ac
+++ b/sysdeps/s390/s390-64/configure.ac
@@ -4,7 +4,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Minimal checking for static PIE support in ld.
 # Compare to ld testcase/bugzilla:
 # <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd
-AC_CACHE_CHECK([for s390-specific static PIE requirements (runtime check)], \
+AC_CACHE_CHECK([for s390-specific static PIE requirements], \
 [libc_cv_s390x_staticpie_req_runtime], [dnl
   cat > conftest1.c <<EOF
 __thread int * foo;
@@ -42,8 +42,8 @@ EOF
   if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest1.c -o conftest1.o]) \
      && AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest2.c -o conftest2.o]) \
      && AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostartfiles -nostdlib -fPIE -o conftest conftest1.o conftest2.o]) \
-     && AC_TRY_COMMAND([! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF]) \
-     && AC_TRY_COMMAND([LC_ACLL=C $READELF -d conftest | grep JMPREL])
+     && AC_TRY_COMMAND([! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF] >&AS_MESSAGE_LOG_FD) \
+     && AC_TRY_COMMAND([LC_ALL=C $READELF -Wd conftest | grep JMPREL >&AS_MESSAGE_LOG_FD])
   then
     libc_cv_s390x_staticpie_req_runtime=yes
   fi

base-commit: 71dafdf5f19dd2b0729e4774149944911a405bc6


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

* Re: [PATCH v3] s390x: Capture grep output in static PIE check
  2024-06-20 12:38 [PATCH v3] s390x: Capture grep output in static PIE check Florian Weimer
@ 2024-06-20 13:02 ` Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-06-20 13:02 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

Florian Weimer <fweimer@redhat.com> writes:

> The test is not a run-time check, so update the description.
> Also use readelf -W for a more stable output format and fix
> an LC_ALL typo.
>
> This avoids garbled configure messages:
>
> checking for s390-specific static PIE requirements (runtime check)...  0x0000000000000017 (JMPREL)             0x280
> yes

Looks good. Thanks!

>
> ---
> v3: Fix LC_ALL typo.
>  sysdeps/s390/s390-64/configure    | 8 ++++----
>  sysdeps/s390/s390-64/configure.ac | 6 +++---
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/sysdeps/s390/s390-64/configure b/sysdeps/s390/s390-64/configure
> index 33c28614c2..9ea6940c85 100644
> --- a/sysdeps/s390/s390-64/configure
> +++ b/sysdeps/s390/s390-64/configure
> @@ -4,8 +4,8 @@
>  # Minimal checking for static PIE support in ld.
>  # Compare to ld testcase/bugzilla:
>  # <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd
> -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements (runtime check)" >&5
> -printf %s "checking for s390-specific static PIE requirements (runtime check)... " >&6; }
> +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements" >&5
> +printf %s "checking for s390-specific static PIE requirements... " >&6; }
>  if { as_var=\
>  libc_cv_s390x_staticpie_req_runtime; eval test \${$as_var+y}; }
>  then :
> @@ -62,13 +62,13 @@ EOF
>    ac_status=$?
>    printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
>    test $ac_status = 0; }; } \
> -     && { ac_try='! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF'
> +     && { ac_try='! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF >&5'
>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>    (eval $ac_try) 2>&5
>    ac_status=$?
>    printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
>    test $ac_status = 0; }; } \
> -     && { ac_try='LC_ACLL=C $READELF -d conftest | grep JMPREL'
> +     && { ac_try='LC_ALL=C $READELF -Wd conftest | grep JMPREL >&5'
>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>    (eval $ac_try) 2>&5
>    ac_status=$?
> diff --git a/sysdeps/s390/s390-64/configure.ac b/sysdeps/s390/s390-64/configure.ac
> index fd729e1496..aaf71eabb1 100644
> --- a/sysdeps/s390/s390-64/configure.ac
> +++ b/sysdeps/s390/s390-64/configure.ac
> @@ -4,7 +4,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>  # Minimal checking for static PIE support in ld.
>  # Compare to ld testcase/bugzilla:
>  # <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd
> -AC_CACHE_CHECK([for s390-specific static PIE requirements (runtime check)], \
> +AC_CACHE_CHECK([for s390-specific static PIE requirements], \
>  [libc_cv_s390x_staticpie_req_runtime], [dnl
>    cat > conftest1.c <<EOF
>  __thread int * foo;
> @@ -42,8 +42,8 @@ EOF
>    if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest1.c -o conftest1.o]) \
>       && AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest2.c -o conftest2.o]) \
>       && AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostartfiles -nostdlib -fPIE -o conftest conftest1.o conftest2.o]) \
> -     && AC_TRY_COMMAND([! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF]) \
> -     && AC_TRY_COMMAND([LC_ACLL=C $READELF -d conftest | grep JMPREL])
> +     && AC_TRY_COMMAND([! LC_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF] >&AS_MESSAGE_LOG_FD) \
> +     && AC_TRY_COMMAND([LC_ALL=C $READELF -Wd conftest | grep JMPREL >&AS_MESSAGE_LOG_FD])
>    then
>      libc_cv_s390x_staticpie_req_runtime=yes
>    fi
>
> base-commit: 71dafdf5f19dd2b0729e4774149944911a405bc6

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

end of thread, other threads:[~2024-06-20 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-20 12:38 [PATCH v3] s390x: Capture grep output in static PIE check Florian Weimer
2024-06-20 13:02 ` Sam James

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).