From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A97311F8C6 for ; Mon, 16 Aug 2021 05:00:31 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FEC9383D017 for ; Mon, 16 Aug 2021 05:00:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FEC9383D017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629090030; bh=Z/qxwLD+w0k6oRr7yVfY5T2VN6Shz4orHUm/mzDROo8=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iRwMDtbSW01l8gVhlJEnOk4gR3x1wT33yG8zmgPnL3QXLWRGsODb4piPS2r4RCXbK SUhAP3LBzaRQpKeEbHZdmgU4di3aCL2wH1azuwtnTn6kol75DmBGAXpFGq4afmHHFR Jko8qT6bWiDxcx9mYDA6BUBd8EkiSzXbUW2Gl1ko= Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by sourceware.org (Postfix) with ESMTPS id BC5BF385042D for ; Mon, 16 Aug 2021 05:00:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC5BF385042D Received: by mail-yb1-xb31.google.com with SMTP id i8so7775154ybt.7 for ; Sun, 15 Aug 2021 22:00:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=Z/qxwLD+w0k6oRr7yVfY5T2VN6Shz4orHUm/mzDROo8=; b=R0vlju1M2SKsN76ql9j3fMtWPC1lv6rPEQygtYaFfFMQE3pLtZNmE3zokyDVpNR+tg NAE26oho8aPt2C1fL1eUW/WOcn7ph0ZLjdLCAcBP3bClrwMgI5VwZtvFEFrFBl4PRH4+ Bx2mSmf/Cq5sHVGcIphLls9g/05udcYBIc+tHuQSGEzC72JmgCK6HuvTYsMJ9zwSRLrI 3QGKyJm+fRmvpmDtOSyVOBhQ97+1LZM5Wc7USO/YV1KUeFqlpt39GJj2nmxE3ElN1Yvb 5b5earOKRR4lmD+Lwk3yrT6uG3pTGHmpQTMhLKHi+5r9FrBiUkp2B3Mt8NyGhAn0oISD uaLA== X-Gm-Message-State: AOAM533DHGVmShPHlmGMu95zPWiOIqMIFW+g/LLAIxHJnbjgFTDryZX+ VusLvYnYFIDStg+V5mgsuYQ0jlEbyOfIGIp6EuXArFkFBW4= X-Google-Smtp-Source: ABdhPJwW/8yQPrx2eu3v7LXLWzLE6b2i+z3qA5HEjY02x4drCnAfuudTDOKbVLAN+Y4pV9a0djifT8h1mpiQ32Kuvak= X-Received: by 2002:a25:19d7:: with SMTP id 206mr17719454ybz.240.1629090001026; Sun, 15 Aug 2021 22:00:01 -0700 (PDT) MIME-Version: 1.0 References: <20210805162601.1200851-1-maskray@google.com> <20210805162601.1200851-3-maskray@google.com> In-Reply-To: <20210805162601.1200851-3-maskray@google.com> Date: Sun, 15 Aug 2021 21:59:50 -0700 Message-ID: Subject: Re: [PATCH v2 2/3] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit [BZ #28151] To: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: , From: =?utf-8?q?F=C4=81ng-ru=C3=AC_S=C3=B2ng_via_Libc-alpha?= Reply-To: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Ping.. On Thu, Aug 5, 2021 at 9:26 AM Fangrui Song wrote: > > gold and ld.lld do not support --audit or --depaudit. > --- > configure | 34 ++++++++++++++++++++++++++++++++++ > configure.ac | 4 ++++ > elf/Makefile | 4 +++- > 3 files changed, 41 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index 9619c10991..9b966196d4 100755 > --- a/configure > +++ b/configure > @@ -5969,6 +5969,40 @@ $as_echo "$libc_linker_feature" >&6; } > config_vars=3D"$config_vars > have-z-start-stop-gc =3D $libc_cv_z_start_stop_gc" > > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that suppor= ts --depaudit" >&5 > +$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 < +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' > + { { 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* > + fi > +fi > +if test $libc_linker_feature =3D yes; then > + libc_cv_depaudit=3Dyes > +else > + libc_cv_depaudit=3Dno > +fi > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >= &5 > +$as_echo "$libc_linker_feature" >&6; } > +config_vars=3D"$config_vars > +have-depaudit =3D $libc_cv_depaudit" > + > { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that suppor= ts --no-dynamic-linker" >&5 > $as_echo_n "checking for linker that supports --no-dynamic-linker... " >= &6; } > libc_linker_feature=3Dno > diff --git a/configure.ac b/configure.ac > index 34ecbba540..17a4c9a1ab 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1337,6 +1337,10 @@ LIBC_LINKER_FEATURE([-z start-stop-gc], [-Wl,-z,st= art-stop-gc], > [libc_cv_z_start_stop_gc=3Dyes], [libc_cv_z_start_sto= p_gc=3Dno]) > LIBC_CONFIG_VAR([have-z-start-stop-gc], [$libc_cv_z_start_stop_gc]) > > +LIBC_LINKER_FEATURE([--depaudit], [-Wl,--depaudit,x], > + [libc_cv_depaudit=3Dyes], [libc_cv_depaudit=3Dno]) > +LIBC_CONFIG_VAR([have-depaudit], [$libc_cv_depaudit]) > + > LIBC_LINKER_FEATURE([--no-dynamic-linker], > [-Wl,--no-dynamic-linker], > [libc_cv_no_dynamic_linker=3Dyes], > diff --git a/elf/Makefile b/elf/Makefile > index d05f410592..b62278ee86 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -219,7 +219,6 @@ tests +=3D restest1 preloadtest loadfail multiload or= igtest resolvfail \ > tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfai= l \ > tst-dlopenfail-2 \ > tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen = \ > - tst-audit14 tst-audit15 tst-audit16 tst-audit17 \ > tst-single_threaded tst-single_threaded-pthread \ > tst-tls-ie tst-tls-ie-dlmopen argv0test \ > tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask = \ > @@ -238,6 +237,9 @@ selinux-enabled :=3D $(shell cat /selinux/enforce 2> = /dev/null) > ifneq ($(selinux-enabled),1) > tests-execstack-yes =3D tst-execstack tst-execstack-needed tst-execstack= -prog > endif > +ifeq ($(have-depaudit),yes) > +tests +=3D tst-audit14 tst-audit15 tst-audit16 > +endif > endif > tests +=3D $(tests-execstack-$(have-z-execstack)) > ifeq ($(run-built-tests),yes) > -- > 2.32.0.605.g8dce9f2422-goog > --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF