Ignore:
Timestamp:
04/26/2017 03:01:26 AM (7 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 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, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 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:
826bbcc
Parents:
8a5a68d
Message:

Update to vim-8.0.586.
Update to eudev-3.2.2.
Update to linux-4.10.12.
Update to gperf-3.1.
Improve instructions to save debugging information for selected
libraries when stripping at the end of Chapter 6.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11230 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/strippingagain.xml

    r8a5a68d rc32384e  
    1111  <title>Stripping Again</title>
    1212
    13   <para>If the intended user is not a programmer and does not plan to do
     13  <para>This section is optional.  If the intended user is not a
     14  programmer and does not plan to do
    1415  any debugging on the system software, the system size can be decreased
    1516  by about 90 MB by removing the debugging symbols from binaries and
     
    2324  backup of the LFS system in its current state.</para>
    2425
    25   <para>First back up some libraries whose debug symbols are needed when
    26   running regression tests in BLFS packages:</para>
     26  <para>First place the debugging sysmbols for selected libraries
     27  in separate files.  This debugging information is needed if running
     28  regression tests that use <ulink
     29  url='&blfs-book;/general/prog/valgrind.html'>valgrind</ulink> or <ulink
     30  url='&blfs-book;/general/prog/gdb.html'>gdb</ulink> later in BLFS.
     31  </para>
    2732
    2833<!-- also of interest are libgfortan, libgo, libgomp, and libobjc from gcc -->
    29 <screen><userinput>save_libs="ld- libatomic libc- libcilkrts libitm libmpx libpthread"
    30 save_libs="$save_libs libquadmath libsanitizer libstdc++ libthread_db libvtv"
    3134
    32 mkdir -p /var/dbg/lib /var/dbg/usr/lib
     35<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"
    3336
    34 for lib in $save_libs
    35 do
    36     find /usr/lib -name ${lib}*so* -type f -exec cp {} /var/dbg/usr/lib \;
    37     find /lib     -name ${lib}*so* -type f -exec cp {} /var/dbg/lib     \;
    38 done</userinput></screen>
     37cd /lib
     38
     39for LIB in $save_lib; do
     40    objcopy --only-keep-debug $LIB $LIB.dbg
     41    strip --strip-unneeded $LIB
     42    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     43done   
     44
     45save_usrlib="libquadmath.o.0.0.0 libstdc++.so.6.0.22
     46             libmpx.so.2.0.0 libmpxwrappers.so.2.0.0 libitm.so.1.0.0
     47             libcilkrts.so.5.0.0 libatomic.so.1.2.0"
     48
     49cd /usr/lib
     50
     51for LIB in $save_usrlib; do
     52    objcopy --only-keep-debug $LIB $LIB.dbg
     53    strip --strip-unneeded $LIB
     54    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     55done
     56
     57unset LIB save_lib save_usrlib</userinput></screen>
    3958
    4059  <para>Before performing the stripping, take special care to ensure that
     
    5877   -exec /tools/bin/strip --strip-debug {} ';'
    5978
    60 /tools/bin/find /lib /usr/lib -type f -name \*.so* \
     79/tools/bin/find /lib /usr/lib -type f \(-name \*.so* -a ! -name \*dbg\) \
    6180   -exec /tools/bin/strip --strip-unneeded {} ';'
    6281
     
    6988  binaries.</para>
    7089
    71   <para>If desired, restore the saved libraries with the debug data
    72   intact.  The files can restored now or just held for later use.  Note
    73   that several of the files cannot be copied directly after rebooting
    74   to the new LFS system. Later use requires booting to another system,
    75   mounting the LFS partition, and then copying the files.</para>
    76 
    77 <screen><userinput>cp -av /var/dbg/lib/* /lib
    78 cp -av /var/dbg/usr/lib/* /usr/lib</userinput></screen>
    79 
    8090</sect1>
Note: See TracChangeset for help on using the changeset viewer.