From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id 175463858C2C; Mon, 25 Apr 2022 23:51:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 175463858C2C Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc/google/grte/v5-2.27/master] configure: Don't check LD -v --help for LIBC_LINKER_FEATURE X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/google/grte/v5-2.27/master X-Git-Oldrev: c0a436544259c7aef8871c29731a48dc715039db X-Git-Newrev: d3c732cb4383d02e5d3099d87766e5853acf9ff8 Message-Id: <20220425235136.175463858C2C@sourceware.org> Date: Mon, 25 Apr 2022 23:51:36 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2022 23:51:36 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d3c732cb4383d02e5d3099d87766e5853acf9ff8 commit d3c732cb4383d02e5d3099d87766e5853acf9ff8 Author: Fangrui Song Date: Mon Apr 25 16:48:25 2022 -0700 configure: Don't check LD -v --help for LIBC_LINKER_FEATURE 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) Diff: --- aclocal.m4 | 19 +++++------ configure | 57 +++++++++++++------------------ sysdeps/unix/sysv/linux/powerpc/configure | 19 +++++------ 3 files changed, 40 insertions(+), 55 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 08fa1ac6d0..fb3eaad9b9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 < conftest.c <&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 diff --git a/configure b/configure index f723098dd8..95887b7078 100755 --- 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 < conftest.c <&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 < conftest.c <&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 < conftest.c <&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 diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure index dab587c81f..8691844500 100644 --- a/sysdeps/unix/sysv/linux/powerpc/configure +++ b/sysdeps/unix/sysv/linux/powerpc/configure @@ -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 < conftest.c <&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