[lfs-book] [LFS Trac] #4076: Optionally exclude libs needed for a sane debugger from stripping
trac at linuxfromscratch.org
Sat Apr 15 13:08:22 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:
Comment (by dj@…):
Replying to [comment:3 bdubbs@…]:
> This appears to be a good thing to do, but I would implement it slightly
differently. I'd create /var/dbg/lib and /var/dbg/usr/lib (the names of
the directories are not particularly critical) and put the non-stripped
files there. The user could then copy them to /lib and /usr/lib as needed
or desired, but not copy back to the main /lib directories automatically.
I don't particularly care where we put them. /var/dbg works for me as long
as it doesn't break FHS/LSB. Make it optional of course, as it negates one
of the reasons for stripping in the first place (saving space). I figure
that the needed files are already in place, just save them in the event
that they are needed later, rather than suggesting an unnecessary rebuild
of glibc and/or gcc later in BLFS.
> We might even want to create a parallel set of directories for storage
of the stripped libraries and a couple of scripts to copy one set or the
other into /usr/lib and /lib.
> This later suggestion would probably be better as a hint.
I included the additional GCC language libraries in the above commands
specifically for the case of the above, as you can always repeat the
stripping commands after you are done using the debugger, and the
additions don't hurt anything if they are not present.
Me personally, I'm more inclined to copy them back unconditionally (as
above), i.e.: don't ever strip these libraries (the 'unless you are doing
an embedded or space constrained build' is implied, but much more than
stripping is involved in those targets anyway). If we really wanted to
make it more integrated, we could create a 'strip-whole-system.sh' script
and add a config file in /etc with a list of exclusions. Just append to
the config file in BLFS. From my POV, however, just keeping a copy of the
ones known to be needed for gdb and Valgrind seems sufficient for
illuminating this particular dark corner for readers. Anything more would
probably be unnecessary hand-holding.
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/4076#comment:4>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.
More information about the lfs-book