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: AS3215 2.6.0.0/16 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 222CA1F8C6 for ; Tue, 24 Aug 2021 03:57:01 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C6C1385800A for ; Tue, 24 Aug 2021 03:56:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C6C1385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629777419; bh=1a1uJWwJm7vC+WE3v6w1T4Ytb4SYWzBK1B0oubJjLCg=; 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=jGv3W8p16SOE0yPCbKTpiLfhY8d/dMgRJ2HnrnD+VaRPHUsqW08yn503mpKJEtKFI sChe1DzdS5AIVOfhrEMcypSbu85rxBFny8p45i6Ixd0AfOOHeDNdIz5MsGhBjgw+LW XXyecM9N0nj7b/rTE5JvzCU53LnRzvmiMPreujyw= 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 BD7F13858C2C for ; Tue, 24 Aug 2021 03:56:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD7F13858C2C Received: by mail-yb1-xb31.google.com with SMTP id a93so38380627ybi.1 for ; Mon, 23 Aug 2021 20:56:30 -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=1a1uJWwJm7vC+WE3v6w1T4Ytb4SYWzBK1B0oubJjLCg=; b=jFeM2OQF1i58Ktda24WUhfSglrG5CNM4nzVckkb3qxH+SxiTcpddl2ETUkNhlLaZ/E L3Ga4eYvfEpwLqKPbzCaftVBS/3JhrXTUaIsWYUr2KLoAUkZFq0ZPXS9Ld/873lL0GJc L4c5CrV7huj0Tj8+QKmxljdbNn2XiHp7YtvjvcuPb60zGakjzTX1H6+pu0Sd+OFLajyC MS+Eqhszr+qfWo5OOvDmDhm0eiB1QArdKFpeKTD6kdl9THp2zUI5qV+HE8Y69wQqwIHp LvUsJxR9QYwVALT9GAVduI/6roDty2X4LFeUedxZ3JAfXa8VcUBQtQAywu9kAvIhEUjo fN3g== X-Gm-Message-State: AOAM533VfTkLa1Tx2lR5QTpKjLbsr6pPHYBJ4x0uDmX0KAZI+EMeced/ 8EJlcVokMzTKggw5i1OggGP030MtIpzFrqVcCVTGBrIVU2x/DA== X-Google-Smtp-Source: ABdhPJxxq4zok32FScrUISxdm11MwTKyhW9LW8qpiFwyTfHC1z5JIV3z8y65q7ddlzM3tcG2SRVh+lce4isaGYh2r6w= X-Received: by 2002:a25:3057:: with SMTP id w84mr26672842ybw.507.1629777390001; Mon, 23 Aug 2021 20:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20210805162601.1200851-1-maskray@google.com> <20210805162601.1200851-3-maskray@google.com> In-Reply-To: Date: Mon, 23 Aug 2021 20:56:19 -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" I'll push this specific commit if there are no objections. On Sun, Aug 15, 2021 at 9:59 PM F=C4=81ng-ru=C3=AC S=C3=B2ng wrote: > > 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 supp= orts --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 -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* > > + 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 supp= orts --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,= start-stop-gc], > > [libc_cv_z_start_stop_gc=3Dyes], [libc_cv_z_start_s= top_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 = origtest resolvfail \ > > tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenf= ail \ > > tst-dlopenfail-2 \ > > tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlope= n \ > > - 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-mas= k \ > > @@ -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-execsta= ck-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 > > > > > -- > =E5=AE=8B=E6=96=B9=E7=9D=BF --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF