stripping: Switch to zstd to compress debug info

Now BLFS has valgrind-3.25.0 which supports zstd-compressed debug
section.
This commit is contained in:
Xi Ruoyao 2025-05-01 21:34:32 +08:00
parent 9056a5ccae
commit 7a6cafbe95
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -34,11 +34,8 @@
After stripping with --strip-debug it is 5.9 MB. Using --strip-unneeded only
reduces the size further to only 5.8 MB.</para>
<!-- TODO: Zstd is better than Zlib for both speed and size.
Unfortunately Valgrind does not support Zstd-compressed debug
info yet: https://bugs.kde.org/show_bug.cgi?id=469782 -->
<para>The debugging symbols from selected libraries are compressed with
<application>Zlib</application> and preserved in separate files. That
<application>Zstd</application> and preserved in separate files. That
debugging information is needed to run regression tests with <ulink
url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink
url='&blfs-book;/general/gdb.html'>gdb</ulink> later, in BLFS.
@ -86,7 +83,7 @@
cd /usr/lib
for LIB in $save_usrlib; do
objcopy --only-keep-debug --compress-debug-sections=zlib $LIB $LIB.dbg
objcopy --only-keep-debug --compress-debug-sections=zstd $LIB $LIB.dbg
cp $LIB /tmp/$LIB
strip --strip-debug /tmp/$LIB
objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB