mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] ptxd_install_compression_format: handle no debug compression
@ 2025-12-09 22:52 Ladislav Michl
  2025-12-10 16:36 ` Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Ladislav Michl @ 2025-12-09 22:52 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@triops.cz>

Some toolchains do not compress debug sections causing later objcopy
failure such as:
aarch64-linux-gnu-objcopy: unrecognized --compress-debug-sections type `'

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 scripts/lib/ptxd_make_xpkg_pkg.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 6cac52e88..ece734450 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -390,7 +390,10 @@ ptxd_install_compression_format() {
 
     libc="$(ptxd_cross_cc -print-file-name=libc.so.6 2> /dev/null)"
     if [ -f "${libc}" ]; then
-	comp="=$($(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')"
+	comp="$($(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')"
+	if [ -n "${comp}" ]; then
+	    comp="=${comp}"
+	fi
     fi
     export ptxd_install_file_objcopy_args="--only-keep-debug --compress-debug-sections${comp}"
 }
-- 
2.47.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] ptxd_install_compression_format: handle no debug compression
  2025-12-09 22:52 [ptxdist] [PATCH] ptxd_install_compression_format: handle no debug compression Ladislav Michl
@ 2025-12-10 16:36 ` Michael Olbrich
  2025-12-11  7:46   ` Ladislav Michl
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2025-12-10 16:36 UTC (permalink / raw)
  To: Ladislav Michl; +Cc: ptxdist

On Tue, Dec 09, 2025 at 11:52:56PM +0100, Ladislav Michl wrote:
> From: Ladislav Michl <ladis@triops.cz>
> 
> Some toolchains do not compress debug sections causing later objcopy
> failure such as:
> aarch64-linux-gnu-objcopy: unrecognized --compress-debug-sections type `'

You're not the only one that found this.. I have a slightly more compact
version that is currently in my test queue, but the result is the same.

Michael

> 
> Signed-off-by: Ladislav Michl <ladis@triops.cz>
> ---
>  scripts/lib/ptxd_make_xpkg_pkg.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
> index 6cac52e88..ece734450 100644
> --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> @@ -390,7 +390,10 @@ ptxd_install_compression_format() {
>  
>      libc="$(ptxd_cross_cc -print-file-name=libc.so.6 2> /dev/null)"
>      if [ -f "${libc}" ]; then
> -	comp="=$($(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')"
> +	comp="$($(ptxd_get_ptxconf PTXCONF_COMPILER_PREFIX)readelf -t "${libc}" | sed -n -e '/COMPRESSED/{N;s/.*\(ZLIB\|ZSTD\).*/\1/p;q}' | tr '[:upper:]' '[:lower:]')"
> +	if [ -n "${comp}" ]; then
> +	    comp="=${comp}"
> +	fi
>      fi
>      export ptxd_install_file_objcopy_args="--only-keep-debug --compress-debug-sections${comp}"
>  }
> -- 
> 2.47.3
> 
> 

-- 
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 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] ptxd_install_compression_format: handle no debug compression
  2025-12-10 16:36 ` Michael Olbrich
@ 2025-12-11  7:46   ` Ladislav Michl
  0 siblings, 0 replies; 3+ messages in thread
From: Ladislav Michl @ 2025-12-11  7:46 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: ptxdist

On Wed, Dec 10, 2025 at 05:36:55PM +0100, Michael Olbrich wrote:
> On Tue, Dec 09, 2025 at 11:52:56PM +0100, Ladislav Michl wrote:
> > From: Ladislav Michl <ladis@triops.cz>
> > 
> > Some toolchains do not compress debug sections causing later objcopy
> > failure such as:
> > aarch64-linux-gnu-objcopy: unrecognized --compress-debug-sections type `'
> 
> You're not the only one that found this.. I have a slightly more compact
> version that is currently in my test queue, but the result is the same.

I'm happy with whatever working version :) I've replaced
scripts/lib/ptxd_make_xpkg_pkg.sh in my BSP with fixed
version, so there is no rush.

Thanks,
	ladis



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-11  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09 22:52 [ptxdist] [PATCH] ptxd_install_compression_format: handle no debug compression Ladislav Michl
2025-12-10 16:36 ` Michael Olbrich
2025-12-11  7:46   ` Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox