From 8438135d3481853e300e1043cfee3946dadb28b3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 25 Oct 2021 13:17:44 -0700 Subject: 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. --- aclocal.m4 | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'aclocal.m4') diff --git a/aclocal.m4 b/aclocal.m4 index c195c4db56..65a12df047 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -224,20 +224,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 -- cgit 1.4.1