Ignore:
Timestamp:
07/28/2021 10:46:22 AM (3 years ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
46e4486
Parents:
79902f4
git-author:
Xi Ruoyao <xry111@…> (07/28/2021 09:00:25 AM)
git-committer:
Xi Ruoyao <xry111@…> (07/28/2021 10:46:22 AM)
Message:

always use --strip-unneeded for stripping

The behavior of --strip-unneeded and --strip-all are same for
executables and shared libraries. For static libraries,
--strip-unneeded keeps the symbols needed for relocation processing so
it won't break static archives.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter08/strippingagain.xml

    r79902f4 r08f72423  
    6868for BIN in $online_usrbin; do
    6969    cp /usr/bin/$BIN /tmp/$BIN
    70     strip --strip-all /tmp/$BIN
     70    strip --strip-unneeded /tmp/$BIN
    7171    install -vm755 /tmp/$BIN /usr/bin
    7272    rm /tmp/$BIN
     
    8080done
    8181
    82 find /usr/lib -type f -name \*.a \
    83    -exec strip --strip-debug {} ';'
    84 
    85 for i in $(find /usr/lib -type f -name \*.so* ! -name \*dbg); do
    86     case "$online_usrlib $save_usrlib" in
     82for i in $(find /usr/lib -type f -name \*.so* ! -name \*dbg) \
     83         $(find /usr/lib -type f -name \*.a)                 \
     84         $(find /usr/{bin,sbin,libexec} -type f); do
     85    case "$online_usrbin $online_usrlib $save_usrlib" in
    8786        *$(basename $i)* )
    8887            ;;
     
    9190    esac
    9291done
    93 
    94 for i in $(find /usr/bin -type f); do
    95     case "$online_usrbin" in
    96         *$(basename $i)* )
    97             ;;
    98         * ) strip --strip-all $i
    99             ;;
    100     esac
    101 done
    102 
    103 find /usr/{sbin,libexec} -type f \
    104     -exec strip --strip-all {} ';'
    10592
    10693unset BIN LIB save_usrlib online_usrbin online_usrlib
Note: See TracChangeset for help on using the changeset viewer.