[lfs] branch trunk updated: Revert "Change stripping to use --strip-debug"
| Newsgroups | gmane.linux.lfs.book |
|---|---|
| Message-ID | <177276334581.19268.193797497293834611@rivendell.linuxfromscratch.org> |
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch trunk
in repository lfs.
The following commit(s) were added to refs/heads/trunk by this push:
new 2021aa2c3 Revert "Change stripping to use --strip-debug"
2021aa2c3 is described below
commit 2021aa2c3b387bcd7c15aa8326d2df1ad5fca30c
Author: Xi Ruoyao <[email protected]>
AuthorDate: Fri Mar 6 10:08:20 2026 +0800
Revert "Change stripping to use --strip-debug"
This reverts commit 3d1e81b5a8397464f2ef0f54fb22b810c03c24c2.
We switched from --strip-unneeded to --strip-debug some time ago after
we found the former "broke" libc.a, causing all rust programs linked
against it to crash. In Aug 2025 I reported it as a binutils issue but
finally it turned out to be a bug in libc.a itself.
The bug is fixed in glibc 2.43 but we didn't really have much time
between glibc 2.43 and LFS 13.0 so I didn't revert our ad-hoc fix for
13.0. Revert it now at the early stage of 13.1 and we'll have some
months to see what will happen.
I've stripped libc.a and run the rustc test suite, no regressions from
an unstripped libc.a.
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33300
---
chapter08/stripping.xml | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml
index 2e8916796..8b3b424c9 100644
--- a/chapter08/stripping.xml
+++ b/chapter08/stripping.xml
@@ -24,17 +24,10 @@
backup of the LFS system in its current state.</para>
<para>A <command>strip</command> command with the
- <parameter>--strip-unneeded</parameter> option removes all debug symbols from
- a binary or library. It also removes all symbol table entries not normally
+ <parameter>--strip-unneeded</parameter> option removes all debug symbols
+ from a binary or library. It also removes all symbol table entries not
needed by the linker (for static libraries) or dynamic linker (for
- dynamically linked binaries and shared libraries). Using
- <parameter>--strip-debug</parameter> does not remove symbol table entries
- that may be needed by some applications. The difference between
- <literal>unneeded</literal> and <literal>debug</literal> is very small.
- For example, an unstripped <filename class='libraryfile'>libc.a</filename>
- is 22.4 MB. After stripping with <parameter>--strip-debug</parameter> it
- is 5.9 MB. Using <parameter>--strip-unneeded</parameter> only reduces the
- size further to 5.8 MB.</para>
+ dynamically linked binaries and shared libraries).</para>
<para>The debugging symbols from selected libraries are compressed with
<application>Zstd</application> and preserved in separate files. That
@@ -87,7 +80,7 @@ cd /usr/lib
for LIB in $save_usrlib; do
objcopy --only-keep-debug --compress-debug-sections=zstd $LIB $LIB.dbg
cp $LIB /tmp/$LIB
- strip --strip-debug /tmp/$LIB
+ strip --strip-unneeded /tmp/$LIB
objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB
install -vm755 /tmp/$LIB /usr/lib
rm /tmp/$LIB
@@ -106,14 +99,14 @@ online_usrlib="libbfd-&binutils-version;.20260210.so
for BIN in $online_usrbin; do
cp /usr/bin/$BIN /tmp/$BIN
- strip --strip-debug /tmp/$BIN
+ strip --strip-unneeded /tmp/$BIN
install -vm755 /tmp/$BIN /usr/bin
rm /tmp/$BIN
done
for LIB in $online_usrlib; do
cp /usr/lib/$LIB /tmp/$LIB
- strip --strip-debug /tmp/$LIB
+ strip --strip-unneeded /tmp/$LIB
install -vm755 /tmp/$LIB /usr/lib
rm /tmp/$LIB
done
@@ -124,7 +117,7 @@ for i in $(find /usr/lib -type f -name \*.so* ! -name \*dbg) \
case "$online_usrbin $online_usrlib $save_usrlib" in
*$(basename $i)* )
;;
- * ) strip --strip-debug $i
+ * ) strip --strip-unneeded $i
;;
esac
done
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
--
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page