From faca1b55e0219f595e77fec2f8ffaa54d42f6a72 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 17 Dec 2025 14:51:52 -0300 Subject: [PATCH] x86_64: Fix mark-plt configure test 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. Reviewed-by: H.J. Lu --- 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 <&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.47.3