[PATCH 6/8] x86_64: Fix mark-plt configure test
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Dec 17 17:51:52 GMT 2025
The configure check might ignore if compiler driver warns that the
option is no support, so force fatal warnings.
If fixes the elf/tst-plt-rewrite{1,2} regressions when ld.lld is used.
---
sysdeps/x86_64/configure | 4 ++--
sysdeps/x86_64/configure.ac | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
index 32324f62da..b4d8bf1370 100644
--- a/sysdeps/x86_64/configure
+++ b/sysdeps/x86_64/configure
@@ -67,7 +67,7 @@ cat > conftest.c <<EOF
int _start (void) { return 42; }
EOF
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
- -Wl,-z,mark-plt -nostdlib -nostartfiles
+ -Wl,-z,mark-plt -Wl,--fatal-warnings -nostdlib -nostartfiles
-fPIC -shared -o conftest.so conftest.c
1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -76,7 +76,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }
then
- if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,mark-plt -nostdlib \
+ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,mark-plt, -Wl,--fatal-warnings -nostdlib \
-nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \
| grep "warning: -z mark-plt ignored" > /dev/null 2>&1; then
true
diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index a00958e219..c4ef4319e4 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -13,7 +13,7 @@ LIBC_TRY_CC_AND_TEST_CC_OPTION([for -mprefer-vector-width=128],
LIBC_CONFIG_VAR([config-cflags-mprefer-vector-width],
[$libc_cv_cc_mprefer_vector_width])
-LIBC_LINKER_FEATURE([-z mark-plt], [-Wl,-z,mark-plt],
+LIBC_LINKER_FEATURE([-z mark-plt], [-Wl,-z,mark-plt -Wl,--fatal-warnings],
[libc_cv_z_mark_plt=yes], [libc_cv_z_mark_plt=no])
LIBC_CONFIG_VAR([have-z-mark-plt], [$libc_cv_z_mark_plt])
--
2.43.0
More information about the Libc-alpha
mailing list