s390x: Capture grep output in static PIE check

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
This commit is contained in:
Florian Weimer 2024-06-20 10:40:02 +02:00
parent 71dafdf5f1
commit 362588f7cc
2 changed files with 7 additions and 7 deletions

View File

@ -4,8 +4,8 @@
# Minimal checking for static PIE support in ld. # Minimal checking for static PIE support in ld.
# Compare to ld testcase/bugzilla: # Compare to ld testcase/bugzilla:
# <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd # <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\n" "$as_me:${as_lineno-$LINENO}: checking for s390-specific static PIE requirements" >&5
printf %s "checking for s390-specific static PIE requirements (runtime check)... " >&6; } printf %s "checking for s390-specific static PIE requirements... " >&6; }
if { as_var=\ if { as_var=\
libc_cv_s390x_staticpie_req_runtime; eval test \${$as_var+y}; } libc_cv_s390x_staticpie_req_runtime; eval test \${$as_var+y}; }
then : then :
@ -62,13 +62,13 @@ EOF
ac_status=$? ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } \ 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 echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; } \ 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 echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?

View File

@ -4,7 +4,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Minimal checking for static PIE support in ld. # Minimal checking for static PIE support in ld.
# Compare to ld testcase/bugzilla: # Compare to ld testcase/bugzilla:
# <binutils-source>/ld/testsuite/ld-elf/pr22263-1.rd # <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 [libc_cv_s390x_staticpie_req_runtime], [dnl
cat > conftest1.c <<EOF cat > conftest1.c <<EOF
__thread int * foo; __thread int * foo;
@ -42,8 +42,8 @@ EOF
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -fPIE -c conftest1.c -o conftest1.o]) \ 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 -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([${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_ALL=C $READELF -Wr conftest | grep R_390_TLS_TPOFF] >&AS_MESSAGE_LOG_FD) \
&& AC_TRY_COMMAND([LC_ACLL=C $READELF -d conftest | grep JMPREL]) && AC_TRY_COMMAND([LC_ALL=C $READELF -Wd conftest | grep JMPREL >&AS_MESSAGE_LOG_FD])
then then
libc_cv_s390x_staticpie_req_runtime=yes libc_cv_s390x_staticpie_req_runtime=yes
fi fi