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=-5.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, 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 007781F8C6 for ; Tue, 24 Aug 2021 12:05:01 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 82AD03857C52 for ; Tue, 24 Aug 2021 12:04:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82AD03857C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629806697; bh=WCZxLABqS674b5iaZ3GgBYdxa++6fvJmM54VT4YIMPQ=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ufwXVObPGAwSfBFGVnQVduNNCeWsf2GJuNM/TzO5oD6fLBTnZRlq4LjAE8Mn+h8OP Rb2yGYUJaRCyo7e+676WlJ/kAWW7YX+BSz1Lkop8gf4VhSMKx2ISdUfVS04PYz63/5 R304ddikVwgwJkt2aoaggdSLPncT7xAr92o6qq3E= Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id B2A783857C52 for ; Tue, 24 Aug 2021 12:04:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2A783857C52 Received: by mail-qv1-xf33.google.com with SMTP id j9so11500764qvt.4 for ; Tue, 24 Aug 2021 05:04:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WCZxLABqS674b5iaZ3GgBYdxa++6fvJmM54VT4YIMPQ=; b=N5sHBoZq63VoNC+7zjPu+dBeIQSJbPxICxUsjimCIvquVuv2D0nmgz687tv3Mn54wK PLTMCcrXBeJOZzOxnXUZTDp7p3jnDZgY7UC9huxpvMwqHq5m+iXiFudrryz6mEtULkOM 435koiO8o4kRzgFv+UjlpGGETIubNIt2iTzsmyR+Cqo2+PlLQC3qSegPfgkJYrgQqLlH M37tZMJ2g3ekIK6IWVtLGN3jGYw4fNa3e+FnG5BVeZcu5bthrDQIaeTWpOT4J/om5thy NlWw8Kt3KoXwyNWhtB69RyljOdjxjTffrGNxedY4n66u7+oKUU5yh9/SS0EGq+9knHuK ZxEQ== X-Gm-Message-State: AOAM531beldRlJZnT22dj8NM7MC0i+avCP/m+iCB2eNDG516qQ0If+f1 bjsNBvXONbsT/1swY59LEKAqNw== X-Google-Smtp-Source: ABdhPJzLK2FMTz1qq+U+Vh4bsRIvM1QYb/wW8GyugQx8ZeWPtk2RdScr6pZwDVr5X6FAikzkix+qog== X-Received: by 2002:a05:6214:5094:: with SMTP id kk20mr38576985qvb.3.1629806663447; Tue, 24 Aug 2021 05:04:23 -0700 (PDT) Received: from ?IPv6:2804:431:c7ca:cd83:3337:ab4f:e3a1:7ba5? ([2804:431:c7ca:cd83:3337:ab4f:e3a1:7ba5]) by smtp.gmail.com with ESMTPSA id y185sm10674811qkb.36.2021.08.24.05.04.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Aug 2021 05:04:23 -0700 (PDT) Subject: Re: [PATCH v2 2/3] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit [BZ #28151] To: libc-alpha@sourceware.org, Fangrui Song References: <20210805162601.1200851-1-maskray@google.com> <20210805162601.1200851-3-maskray@google.com> Message-ID: <3b2fbaf5-8e14-4da7-f431-1720d14d1232@linaro.org> Date: Tue, 24 Aug 2021 09:04:21 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210805162601.1200851-3-maskray@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 05/08/2021 13:26, Fangrui Song via Libc-alpha wrote: > gold and ld.lld do not support --audit or --depaudit. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > 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="$config_vars > have-z-start-stop-gc = $libc_cv_z_start_stop_gc" > > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --depaudit" >&5 > +$as_echo_n "checking for linker that supports --depaudit... " >&6; } > +libc_linker_feature=no > +if test x"$gnu_ld" = x"yes"; then > + libc_linker_check=`$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='${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=$? > + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 > + test $ac_status = 0; }; } > + then > + libc_linker_feature=yes > + fi > + rm -f conftest* > + fi > +fi > +if test $libc_linker_feature = yes; then > + libc_cv_depaudit=yes > +else > + libc_cv_depaudit=no > +fi > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5 > +$as_echo "$libc_linker_feature" >&6; } > +config_vars="$config_vars > +have-depaudit = $libc_cv_depaudit" > + > { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports --no-dynamic-linker" >&5 > $as_echo_n "checking for linker that supports --no-dynamic-linker... " >&6; } > libc_linker_feature=no > 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=yes], [libc_cv_z_start_stop_gc=no]) > LIBC_CONFIG_VAR([have-z-start-stop-gc], [$libc_cv_z_start_stop_gc]) > > +LIBC_LINKER_FEATURE([--depaudit], [-Wl,--depaudit,x], > + [libc_cv_depaudit=yes], [libc_cv_depaudit=no]) > +LIBC_CONFIG_VAR([have-depaudit], [$libc_cv_depaudit]) > + > LIBC_LINKER_FEATURE([--no-dynamic-linker], > [-Wl,--no-dynamic-linker], > [libc_cv_no_dynamic_linker=yes], Ok. > diff --git a/elf/Makefile b/elf/Makefile > index d05f410592..b62278ee86 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -219,7 +219,6 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \ > tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \ > 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 := $(shell cat /selinux/enforce 2> /dev/null) > ifneq ($(selinux-enabled),1) > tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog > endif > +ifeq ($(have-depaudit),yes) > +tests += tst-audit14 tst-audit15 tst-audit16 > +endif > endif > tests += $(tests-execstack-$(have-z-execstack)) > ifeq ($(run-built-tests),yes) > Ok.