From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 10 Dec 2024 15:06:11 +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 1tL0sN-006Oys-0s for lore@lore.pengutronix.de; Tue, 10 Dec 2024 15:06:11 +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 1tL0sN-0007CY-C9; Tue, 10 Dec 2024 15:06:11 +0100 Received: from mail.thorsis.com ([217.92.40.78]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tL0sG-0007Bp-Rn for ptxdist@pengutronix.de; Tue, 10 Dec 2024 15:06:05 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7F216148641A; Tue, 10 Dec 2024 12:42:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1733830983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kCsJSfkpAxj9UYRrsS/ci1iEEAWLaRT+OTgUwuHgU70=; b=ojE/JcAZ0Xq+TsYqb8nMkRS3L9XsHGMNIurQDg1k400krIl+rm306AnE2JPPHy/a3+Ui6/ 4O+Gp3Gjz9jl3VqN9dCeAe+EHpOgCwYp8NgKZ9ThGGYtz+IqiqE0pFzvDJ59oeaFMKAzZZ TlbwO0QJgOQo4Fs6XSIhuSKNAhIKOUxBhsaWexvv98w5gmgr3tUhsZaG3O1UbRNg/gsxM2 mj1XS3v5nov/Ze2Dn0ejKkpijk4AGoy65qyZKLzfyLWtK7pbo4Y2zyCXwfLykr3iWCI547 Kx2iUJWz4X1CVv6iJHLcuwvnjJW9lQPYpj3VHS9Qxzrg7qx9mQm5qH0w/aTV8A== Date: Tue, 10 Dec 2024 12:42:42 +0100 From: Alexander Dahl To: Carsten Schlote Message-ID: <20241210-finer-rake-2c31e2725956@thorsis.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <26da32b6-a8b1-41db-b302-334af01962ff@gmx.net> User-Agent: Mutt/2.2.12 (2023-09-09) X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 Hello Carsten, Am Tue, Dec 10, 2024 at 09:15:51AM +0100 schrieb Carsten Schlote: > 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:]')" Please don't change indentation. > +    fi > +    if [ "${comp}" == "=" ]; then > +        comp="" Instead of fixing a failed subshell call afterwards, it would probably be better to call it separately and evaluate the result before assinging to 'comp' here? shellcheck warns about this (when called with `-o all`) like this: In scripts/lib/ptxd_make_xpkg_pkg.sh line 393: comp="=$(readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')" ^------------------^ SC2312 (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). ^-- SC2312 (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). See https://www.shellcheck.net/wiki/SC2312 for details. >      fi >      export ptxd_install_file_objcopy_args="--only-keep-debug > --compress-debug-sections${comp}" >  } > > + No need to add an empty line here. Greets Alex >  ptxd_install_compression_format > >  ptxd_install_file_extract_debug() { > >