mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Carsten Schlote <carsten.schlote@gmx.net>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] ptxd_make_xpkg_pkg.sh: Prevent incomplete comp variable and build break
Date: Tue, 10 Dec 2024 09:15:51 +0100	[thread overview]
Message-ID: <26da32b6-a8b1-41db-b302-334af01962ff@gmx.net> (raw)

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 <schlote@vahanus.net>
---
  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:]')"
+    fi
+    if [ "${comp}" == "=" ]; then
+        comp=""
      fi
      export ptxd_install_file_objcopy_args="--only-keep-debug
--compress-debug-sections${comp}"
  }

+
  ptxd_install_compression_format

  ptxd_install_file_extract_debug() {




             reply	other threads:[~2024-12-10  8:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  8:15 Carsten Schlote [this message]
2024-12-10 11:42 ` Alexander Dahl
2024-12-10 14:02 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26da32b6-a8b1-41db-b302-334af01962ff@gmx.net \
    --to=carsten.schlote@gmx.net \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox