]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86_64: Fix mark-plt configure test
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 9 Feb 2024 16:36:22 +0000 (13:36 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:54:55 +0000 (13:54 -0300)
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 regressions when ld.lld is used.

sysdeps/x86_64/configure
sysdeps/x86_64/configure.ac

index 32324f62dad248e15de3cf8b2bd639be431ee84c..b4d8bf13702889d04a7620bff001bfae098e4b02 100644 (file)
@@ -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
index a00958e2197fe912a0fbee0ff1f02e34852e4bbc..c4ef4319e4b5eb4bd1f17c7e75799c7251fba834 100644 (file)
@@ -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])