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=-2.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=no 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 9421E1F8C6 for ; Thu, 29 Jul 2021 16:29:02 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B505939DC4C4 for ; Thu, 29 Jul 2021 16:29:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B505939DC4C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627576141; bh=FoYAZ7BzeKmm+rlIhKnVgfSO+ciqCD1Bd9Tu3OEFnKI=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tLWZIg8XM+5/E0s6hIiYGWo8Pn8BtffGC9r7c7UW0Uc5m58OwrYBaND8c7GgYBdme 75OBzNP+RgcZLzfv7r73NXwPbonIZsrwxikUZ8RybdyQ4faGkfI0TCVutQdH7qvlFr xzQHp6i9+kOpJF2ekggHlHvfM9vam9GGUesgeDAU= Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id C0A633861032 for ; Thu, 29 Jul 2021 16:28:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C0A633861032 Received: by mail-pl1-x630.google.com with SMTP id t21so7545142plr.13 for ; Thu, 29 Jul 2021 09:28:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FoYAZ7BzeKmm+rlIhKnVgfSO+ciqCD1Bd9Tu3OEFnKI=; b=MmK7+9kLCY/CtpyJG83GPgQ29O6f1lwRq7211WwIAh/n28ndLUnn+aACP2NDZYiFum cck+xr7lqK32MHKNKb/y93kWYoegFWPQ9lAvSK6TBaDRbs1onEq7vnT6rSs40M1eFaHW c1IHHKznilACPW/oIxZGfoeEkDubkjKfBRW5DxPojFHoQjsuxFgcor9haShcftospJlS ArS04bn8gk5T7yeQBYnR1+MQfqp6WdM6SEG7+DGH/ND8apLPCm8ZDSH1+aTOyjthfhse 6HgregpmDtx8N8AKRVvK7Azazn9xAtoafibpRGQlGnVEkoogp9L2YSaGndxcFrZeSkXX d9LA== X-Gm-Message-State: AOAM532QwblAgIW5lMXwKAvKoZsMHmc0ZWqipBjnH+CDZosZTAleCQp0 FtmGqfn4DoGXieQNnymbcnsHFA== X-Google-Smtp-Source: ABdhPJzxeHKRyvy/tRNa5WGi/eaEuIoJwfabyQWRFoDbCwhLJN/qHS62juP5mOt4Mv0jzfsA+2TG7Q== X-Received: by 2002:a63:5344:: with SMTP id t4mr4507343pgl.372.1627576118717; Thu, 29 Jul 2021 09:28:38 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:d909:a67b:f0a0:a797]) by smtp.gmail.com with ESMTPSA id x26sm4201244pfm.77.2021.07.29.09.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 09:28:37 -0700 (PDT) Date: Thu, 29 Jul 2021 09:28:34 -0700 To: "H.J. Lu" Subject: Re: [PATCH 2/3] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit Message-ID: <20210729162834.3fgoilnxbujcxw5z@google.com> References: <20210726035802.275992-1-maskray@google.com> <20210726035802.275992-3-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: 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: Fangrui Song via Libc-alpha Reply-To: Fangrui Song Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 2021-07-29, H.J. Lu wrote: >On Sun, Jul 25, 2021 at 9:00 PM Fangrui Song via Libc-alpha > wrote: >> >> gold and ld.lld do not support --audit or --depaudit. > >Please update the commit log for BZ #28151. We are in code freeze for glibc >2.34. Please rebase and submit the v2 patch after glibc 2.34 has been >branched. Will mail v2 after presumably this "The current development version of glibc 2.34, releasing on or around August 1st, 2021." >Thanks. > >> --- >> 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], >> diff --git a/elf/Makefile b/elf/Makefile >> index 87a70d6c7a..09f860a268 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-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) >> -- >> 2.32.0.432.gabb21c7263-goog >> > > >-- >H.J.