From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 10 Dec 2024 15:02:25 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tL0oj-006Owx-0I for lore@lore.pengutronix.de; Tue, 10 Dec 2024 15:02:25 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tL0oj-00068y-89; Tue, 10 Dec 2024 15:02:25 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tL0oV-00068p-2i; Tue, 10 Dec 2024 15:02:11 +0100 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tL0oT-002hUC-39; Tue, 10 Dec 2024 15:02:10 +0100 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tL0oU-008XG4-29; Tue, 10 Dec 2024 15:02:10 +0100 Date: Tue, 10 Dec 2024 15:02:10 +0100 From: Michael Olbrich To: Carsten Schlote Message-ID: Mail-Followup-To: Carsten Schlote , ptxdist@pengutronix.de References: <26da32b6-a8b1-41db-b302-334af01962ff@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <26da32b6-a8b1-41db-b302-334af01962ff@gmx.net> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-IRC: #ptxdist @freenode Subject: Re: [ptxdist] [PATCH] ptxd_make_xpkg_pkg.sh: Prevent incomplete comp variable and build break X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Tue, Dec 10, 2024 at 09:15:51AM +0100, Carsten Schlote wrote: > Changed code to detect broken detection of debug compression type. This > prevents an invalid comp variable ('='), which in turn causes some > abort, when objcopy is called with incomplete arguments. > > If the compression can't be set and the comp variable is just "=", it > will be set to an empty string. The target objcopy tool will use its > internal default for compression in this case. > > Signed-off-by: Carsten Schlote > --- >  scripts/lib/ptxd_make_xpkg_pkg.sh | 6 +++++- >  1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh > b/scripts/lib/ptxd_make_xpkg_pkg.sh > index 08a0ab593..36bb3a564 100644 > --- a/scripts/lib/ptxd_make_xpkg_pkg.sh > +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh > @@ -390,11 +390,15 @@ ptxd_install_compression_format() { > >      libc="$(ptxd_cross_cc -print-file-name=libc.so.6 2> /dev/null)" >      if [ -n "${libc}" ]; then > -    comp="=$(readelf -t "${libc}" | sed -n -e > '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')" > +        comp="=$(readelf -t "${libc}" | sed -n -e > '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')" I think, if you do this (only add the '=' if s/// finds a match):         comp="$(readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/=\1/p;q}' | tr '[:upper:]' '[:lower:]')" > +    fi > +    if [ "${comp}" == "=" ]; then > +        comp="" Then you don't need tis. >      fi >      export ptxd_install_file_objcopy_args="--only-keep-debug > --compress-debug-sections${comp}" Something (Thunderbird?) added extra new-lines that broke the patch. Please send again. If you cannot use 'git send-email' then sending as attachment should work as well. >  } > > + Unrelated whitespace change. Michael >  ptxd_install_compression_format > >  ptxd_install_file_extract_debug() { > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |