From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 17B39385040A for ; Sun, 1 Aug 2021 23:47:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17B39385040A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Date: Mon, 2 Aug 2021 00:47:26 +0100 From: Sergei Trofimovich To: Mark Wielaard Cc: debugedit@sourceware.org Subject: Re: [PATCH] use $READELF, not readelf Message-ID: <20210802004726.606c40ee@zn3> In-Reply-To: References: <20210801201535.3170290-1-slyfox@gentoo.org> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP 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: debugedit@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: debugedit development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Aug 2021 23:47:32 -0000 On Sun, 1 Aug 2021 23:30:04 +0200 Mark Wielaard wrote: > Hi Sergei, > > On Sun, Aug 01, 2021 at 09:15:35PM +0100, Sergei Trofimovich wrote: > > Allow user to specify own readelf. Use detected readelf, > > not 'readelf'. > > > > Noticed as a set of test failures on system with only > > $host-prefixed tools: > > > > debugedit/tests/testsuite.dir/at-groups/4/test-source: > > line 40: readelf: command not found > > > > * configure.ac: Add READELF user override. > > * scripts/find-debuginfo.in: Use @READELF@ instead of 'readelf'. > > * tests/atlocal.in: Populate READELF variable detected by configure. > > * tests/debugedit.at: Use $READELF instad of 'readelf' in tests. > > Good idea. I applied it with two small fixups. > We really need tests for the find-debuginfo script. > There was a typo in the substution name. > And the scripts use a special Makefile rule to do the substitutions. Thank you! I completely forgot to check the result of find-debuginfo substitution. > diff --git a/Makefile.am b/Makefile.am > index 98b2f20..2060b96 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -32,7 +32,8 @@ CLEANFILES = $(bin_SCRIPTS) > > # Some standard substitutions for scripts > do_subst = ($(SED) -e 's,[@]PACKAGE[@],$(PACKAGE),g' \ > - -e 's,[@]VERSION[@],$(VERSION),g') > + -e 's,[@]VERSION[@],$(VERSION),g' \ > + -e 's,[@]READELF[@],$(READELF),g') > > find-debuginfo: $(top_srcdir)/scripts/find-debuginfo.in Makefile > $(do_subst) < "$(top_srcdir)/scripts/$@.in" > "$@" > diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in > index 34f62ed..9c0a735 100755 > --- a/scripts/find-debuginfo.in > +++ b/scripts/find-debuginfo.in > @@ -338,7 +338,7 @@ add_minidebug() > # symbol and NOBITS sections so cannot use --keep-only because that is > # too aggressive. Field $2 is the section name, $3 is the section type > # and $8 are the section flags. > - local remove_sections=`@REAADELF@ -W -S "$debuginfo" \ > + local remove_sections=`@READELF@ -W -S "$debuginfo" \ > | awk '{ if (index($2,".debug_") != 1 \ > && ($3 == "PROGBITS" || $3 == "NOTE" || $3 == "NOBITS") \ > && index($8,"A") == 0) \ > > Thanks, > > Mark -- Sergei