]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
configure: Don't check LD -v --help for LIBC_LINKER_FEATURE
authorFangrui Song <maskray@google.com>
Mon, 25 Apr 2022 23:48:25 +0000 (16:48 -0700)
committerFangrui Song <maskray@google.com>
Mon, 25 Apr 2022 23:48:25 +0000 (16:48 -0700)
When LIBC_LINKER_FEATURE is used to check a linker option with the equal
sign, it will likely fail because the LD -v --help output may look like
`-z lam-report=[none|warning|error]` while the needle is something like
`-z lam-report=warning`.

The LD -v --help filter doesn't save much time, so just remove it.

(cherry picked from commit 8438135d3481853e300e1043cfee3946dadb28b3)

aclocal.m4
configure
sysdeps/unix/sysv/linux/powerpc/configure

index 08fa1ac6d05323fd0bac1f0d8820ba78ba6cf9a0..fb3eaad9b93ee8466278bcbb9d56bd8c68768360 100644 (file)
@@ -223,20 +223,17 @@ AC_DEFUN([LIBC_LINKER_FEATURE],
 [AC_MSG_CHECKING([for linker that supports $1])
 libc_linker_feature=no
 if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
+  cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-                               $2 -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&AS_MESSAGE_LOG_FD])
-    then
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+                   $2 -nostdlib -nostartfiles
+                   -fPIC -shared -o conftest.so conftest.c
+                   1>&AS_MESSAGE_LOG_FD])
+  then
+    libc_linker_feature=yes
   fi
+  rm -f conftest*
 fi
 if test $libc_linker_feature = yes; then
   $3
index f723098dd8d588bca28baf7403fdfd075ac12fb3..95887b707888ed4b744096808c7e4cb5ce1996d3 100755 (executable)
--- a/configure
+++ b/configure
@@ -5879,25 +5879,22 @@ fi
 $as_echo_n "checking for linker that supports -z execstack... " >&6; }
 libc_linker_feature=no
 if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z execstack"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
+  cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-                               -Wl,-z,execstack -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&5'
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+                   -Wl,-z,execstack -nostdlib -nostartfiles
+                   -fPIC -shared -o conftest.so conftest.c
+                   1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
-    then
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
+  then
+    libc_linker_feature=yes
   fi
+  rm -f conftest*
 fi
 if test $libc_linker_feature = yes; then
   libc_cv_z_execstack=yes
@@ -5912,25 +5909,22 @@ $as_echo "$libc_linker_feature" >&6; }
 $as_echo_n "checking for linker that supports -z start-stop-gc... " >&6; }
 libc_linker_feature=no
 if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z start-stop-gc"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
+  cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-                               -Wl,-z,start-stop-gc -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&5'
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+                   -Wl,-z,start-stop-gc -nostdlib -nostartfiles
+                   -fPIC -shared -o conftest.so conftest.c
+                   1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
-    then
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
+  then
+    libc_linker_feature=yes
   fi
+  rm -f conftest*
 fi
 if test $libc_linker_feature = yes; then
   libc_cv_z_start_stop_gc=yes
@@ -5946,25 +5940,22 @@ have-z-start-stop-gc = $libc_cv_z_start_stop_gc"
 $as_echo_n "checking for linker that supports --no-dynamic-linker... " >&6; }
 libc_linker_feature=no
 if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\--no-dynamic-linker"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
+  cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-                               -Wl,--no-dynamic-linker -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&5'
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+                   -Wl,--no-dynamic-linker -nostdlib -nostartfiles
+                   -fPIC -shared -o conftest.so conftest.c
+                   1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
-    then
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
+  then
+    libc_linker_feature=yes
   fi
+  rm -f conftest*
 fi
 if test $libc_linker_feature = yes; then
   libc_cv_no_dynamic_linker=yes
index dab587c81f9df876b90ba88b88b6419abb31ed9a..8691844500365a8ac42b01390e581185f087d787 100644 (file)
@@ -83,25 +83,22 @@ fi # clang
 $as_echo_n "checking for linker that supports --no-tls-get-addr-optimize... " >&6; }
 libc_linker_feature=no
 if test x"$gnu_ld" = x"yes"; then
-  libc_linker_check=`$LD -v --help 2>/dev/null | grep "\--no-tls-get-addr-optimize"`
-  if test -n "$libc_linker_check"; then
-    cat > conftest.c <<EOF
+  cat > conftest.c <<EOF
 int _start (void) { return 42; }
 EOF
-    if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
-                               -Wl,--no-tls-get-addr-optimize -nostdlib -nostartfiles
-                               -fPIC -shared -o conftest.so conftest.c
-                               1>&5'
+  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp
+                   -Wl,--no-tls-get-addr-optimize -nostdlib -nostartfiles
+                   -fPIC -shared -o conftest.so conftest.c
+                   1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
-    then
-      libc_linker_feature=yes
-    fi
-    rm -f conftest*
+  then
+    libc_linker_feature=yes
   fi
+  rm -f conftest*
 fi
 if test $libc_linker_feature = yes; then
   libc_cv_tls_get_addr_optimize=yes