From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by sourceware.org (Postfix) with ESMTPS id 0506F385781A for ; Tue, 19 Oct 2021 17:02:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0506F385781A Received: by mail-yb1-xb2c.google.com with SMTP id d131so7244847ybd.5 for ; Tue, 19 Oct 2021 10:02:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=xqm0UrGcRPVIxqDuo2BzVkpNTlSIJZczuWI2DLrce7s=; b=H3p9xfcYoPCMG0WlcnlChljq5uh+vI/m4u1FoHBFkTfQbdQROvimgG682Wv96Rx5Hl ywj71q5g4U90u5Ch+r8YzQg1VOcLQLTeS+LpsobYZ4vWotVhjMyGdI0DnprCNO3VzQvf LlT5L5kvDeCvI+rDH5C1peaXs0sRw7J84rP2LEnOxj3209PiGyNrHHP9HyhPlj1g4uyZ hR1bCnDpOdz9tpqL7bkKRjlaMerF2vyWt+d9/xEKIt36jPIt21avI0F8yEm1k9KbhTjI EaFSVSxv7p2kces1oB/kcmAOvfWb6K+6kVVCbcG4w/nQi6/E4PF5tJuEtIztA9pC663a 75WA== X-Gm-Message-State: AOAM530iGzAN+JY/gr2Bfmwv3ZhDSghg3L3kmI8H4/VRa5fUgRe8xZ1J dyzP2JAYMR8Z7yzhmww/mFSyrPOnRWUiIEXt3C4fj92LBNR/pQ== X-Google-Smtp-Source: ABdhPJxp4rhdYIa/OsGSy6vMFYxwx3dcJz6qDDwAQlb/80/ovxuhOdRFdf41aDRqeHvHmNVVJ73UmjSdDy++wLnAArQ= X-Received: by 2002:a25:4c3:: with SMTP id 186mr10505498ybe.228.1634662950165; Tue, 19 Oct 2021 10:02:30 -0700 (PDT) MIME-Version: 1.0 References: <20211012002505.839804-1-maskray@google.com> In-Reply-To: <20211012002505.839804-1-maskray@google.com> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Tue, 19 Oct 2021 10:02:19 -0700 Message-ID: Subject: Re: [PATCH] configure: Don't check LD -v --help for LIBC_LINKER_FEATURE To: libc-alpha@sourceware.org, Joseph Myers , "H.J. Lu" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-24.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 17:02:33 -0000 On Mon, Oct 11, 2021 at 5:25 PM Fangrui Song wrote: > > 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=3D[none|warning|error]` while the needle is something like > `-z lam-report=3Dwarning`. > > The LD -v --help filter doesn't save much time, so just remove it. > --- > aclocal.m4 | 19 +++--- > configure | 76 ++++++++++------------- > sysdeps/unix/sysv/linux/powerpc/configure | 19 +++--- > 3 files changed, 48 insertions(+), 66 deletions(-) > > 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=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\$1"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < 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=3Dyes > - 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=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > $3 > diff --git a/configure b/configure > index 39d75eb4ed..3227e434d3 100755 > --- a/configure > +++ b/configure > @@ -5979,25 +5979,22 @@ fi > $as_echo_n "checking for linker that supports -z execstack... " >&6; } > libc_linker_feature=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\-z execstack"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < int _start (void) { return 42; } > EOF > - if { ac_try=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > - -Wl,-z,execstack -nostdlib -nostartfiles > - -fPIC -shared -o conftest.so conftest.c > - 1>&5' > + if { ac_try=3D'${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=3D$? > $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > test $ac_status =3D 0; }; } > - then > - libc_linker_feature=3Dyes > - fi > - rm -f conftest* > + then > + libc_linker_feature=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > libc_cv_z_execstack=3Dyes > @@ -6012,25 +6009,22 @@ $as_echo "$libc_linker_feature" >&6; } > $as_echo_n "checking for linker that supports -z start-stop-gc... " >&6;= } > libc_linker_feature=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\-z start-stop-= gc"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < int _start (void) { return 42; } > EOF > - if { ac_try=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > - -Wl,-z,start-stop-gc -nostdlib -nostartfi= les > - -fPIC -shared -o conftest.so conftest.c > - 1>&5' > + if { ac_try=3D'${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=3D$? > $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > test $ac_status =3D 0; }; } > - then > - libc_linker_feature=3Dyes > - fi > - rm -f conftest* > + then > + libc_linker_feature=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > libc_cv_z_start_stop_gc=3Dyes > @@ -6046,25 +6040,22 @@ have-z-start-stop-gc =3D $libc_cv_z_start_stop_gc= " > $as_echo_n "checking for linker that supports --depaudit... " >&6; } > libc_linker_feature=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\--depaudit"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < int _start (void) { return 42; } > EOF > - if { ac_try=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > - -Wl,--depaudit,x -nostdlib -nostartfiles > - -fPIC -shared -o conftest.so conftest.c > - 1>&5' > + if { ac_try=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > + -Wl,--depaudit,x -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=3D$? > $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > test $ac_status =3D 0; }; } > - then > - libc_linker_feature=3Dyes > - fi > - rm -f conftest* > + then > + libc_linker_feature=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > libc_cv_depaudit=3Dyes > @@ -6080,25 +6071,22 @@ have-depaudit =3D $libc_cv_depaudit" > $as_echo_n "checking for linker that supports --no-dynamic-linker... " >= &6; } > libc_linker_feature=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\--no-dynamic-l= inker"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < int _start (void) { return 42; } > EOF > - if { ac_try=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > - -Wl,--no-dynamic-linker -nostdlib -nostar= tfiles > - -fPIC -shared -o conftest.so conftest.c > - 1>&5' > + if { ac_try=3D'${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=3D$? > $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > test $ac_status =3D 0; }; } > - then > - libc_linker_feature=3Dyes > - fi > - rm -f conftest* > + then > + libc_linker_feature=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > libc_cv_no_dynamic_linker=3Dyes > diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sys= v/linux/powerpc/configure > index ceb1bd7c1b..a4c809fd98 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/configure > +++ b/sysdeps/unix/sysv/linux/powerpc/configure > @@ -80,25 +80,22 @@ fi > $as_echo_n "checking for linker that supports --no-tls-get-addr-optimize= ... " >&6; } > libc_linker_feature=3Dno > if test x"$gnu_ld" =3D x"yes"; then > - libc_linker_check=3D`$LD -v --help 2>/dev/null | grep "\--no-tls-get-a= ddr-optimize"` > - if test -n "$libc_linker_check"; then > - cat > conftest.c < + cat > conftest.c < int _start (void) { return 42; } > EOF > - if { ac_try=3D'${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=3D'${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp > + -Wl,--no-tls-get-addr-optimize -nostdlib -nostartfile= s > + -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=3D$? > $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > test $ac_status =3D 0; }; } > - then > - libc_linker_feature=3Dyes > - fi > - rm -f conftest* > + then > + libc_linker_feature=3Dyes > fi > + rm -f conftest* > fi > if test $libc_linker_feature =3D yes; then > libc_cv_tls_get_addr_optimize=3Dyes > -- > 2.33.0.882.g93a45727a2-goog > Ping=F0=9F=A5=B3