[lfs-book] [LFS Trac] #4076: Optionally exclude libs needed for a sane debugger from stripping

LFS Trac trac at linuxfromscratch.org
Sat Apr 15 11:39:25 PDT 2017


#4076: Optionally exclude libs needed for a sane debugger from stripping
--------------------+-------------------------
 Reporter:  dj@…    |       Owner:  lfs-book@…
     Type:  task    |      Status:  new
 Priority:  normal  |   Milestone:  8.1
Component:  Book    |     Version:  SVN
 Severity:  normal  |  Resolution:
 Keywords:          |
--------------------+-------------------------

Comment (by dj@…):

 Will tak a more thorough look at it later, just getting this into the bug
 tracker. Here is the goal, save for syntax variations (maybe xargs or +
 instead of \, or properly divide the list, etc.):

 {{{
 save_libs="ld- libatomic libc- libcilkrts ligfortran libgo libgomp libitm
 libmpx libobjc libpthread libquadmath libsanitizer libstdc++ libthread_db
 libvtv"

 mkdir -p /tmp/{,usr/}lib

 for lib in $save_libs
 do
     find /usr/lib -name "${lib}*" -type f -exec cp {} /tmp/dbg/usr/lib \;
     find /lib -name "${lib}*" -type f -exec cp {} /tmp/dbg/lib \;
 done

 /tools/bin/find /usr/lib -type f -name \*.a \
    -exec /tools/bin/strip --strip-debug {} ';'

 /tools/bin/find /lib /usr/lib -type f -name \*.so* \
    -exec /tools/bin/strip --strip-unneeded {} ';'

 /tools/bin/find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \
     -exec /tools/bin/strip --strip-all {} ';'

 cp -av /tmp/dbg/lib/* /lib
 cp -av /tmp/dbg/usr/lib/* /usr/lib
 rm -rf /tmp/dbg
 }}}

--
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/4076#comment:2>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.


More information about the lfs-book mailing list