mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
Automatic merge of trunk into multilib
This commit is contained in:
commit
47c0603838
@ -17,8 +17,8 @@
|
||||
the debugger can provide not only memory addresses, but also
|
||||
the names of the routines and variables.</para>
|
||||
|
||||
<para>However, the inclusion of these debugging symbols enlarges a
|
||||
program or library significantly. The following is an example of the
|
||||
<para>The inclusion of these debugging symbols enlarges a
|
||||
program or library significantly. Here are two examples of the
|
||||
amount of space these symbols occupy:</para>
|
||||
|
||||
<itemizedlist>
|
||||
@ -28,7 +28,7 @@
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A <command>bash</command> binary without debugging symbols:
|
||||
480 KB</para>
|
||||
480 KB (60% smaller)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Glibc and GCC files (<filename class="directory">/lib</filename>
|
||||
@ -36,15 +36,14 @@
|
||||
symbols: 87 MB</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Glibc and GCC files without debugging symbols: 16 MB</para>
|
||||
<para>Glibc and GCC files without debugging symbols: 16 MB (82% smaller)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>Sizes may vary depending on which compiler and C library were used,
|
||||
but when comparing programs with and without debugging symbols, the
|
||||
difference will usually be a factor between two and five.</para>
|
||||
|
||||
<para>Because most users will never use a debugger on their system software,
|
||||
<para>Sizes will vary depending on which compiler and C library were used,
|
||||
but a program that has been stripped of debugging symbols is usually some
|
||||
50% to 80% smaller than its unstripped counterpart.
|
||||
Because most users will never use a debugger on their system software,
|
||||
a lot of disk space can be regained by removing these symbols. The next
|
||||
section shows how to strip all debugging symbols from the programs and
|
||||
libraries.</para>
|
||||
|
@ -10,16 +10,16 @@
|
||||
|
||||
<title>Cleaning Up</title>
|
||||
|
||||
<para>Finally, clean up some extra files left around from running tests:</para>
|
||||
<para>Finally, clean up some extra files left over from running tests:</para>
|
||||
|
||||
<screen><userinput>rm -rf /tmp/*</userinput></screen>
|
||||
|
||||
<para>There are also several files installed in the /usr/lib and /usr/libexec
|
||||
<para>There are also several files in the /usr/lib and /usr/libexec
|
||||
directories with a file name extension of .la. These are "libtool archive"
|
||||
files. As already said, on a modern Linux system the libtool .la files are
|
||||
files. On a modern Linux system the libtool .la files are
|
||||
only useful for libltdl. No libraries in LFS are expected to be loaded
|
||||
by libltdl, and it's known that some .la files can cause BLFS packages
|
||||
fail to build. Remove those files now:</para>
|
||||
by libltdl, and it's known that some .la files can break BLFS package
|
||||
builds. Remove those files now:</para>
|
||||
|
||||
<screen><userinput>find /usr/lib /usr/libexec -name \*.la -delete</userinput><userinput arch="ml_32,ml_all">
|
||||
find /usr/lib32 -name \*.la -delete</userinput><userinput arch="ml_x32,ml_all">
|
||||
|
@ -12,39 +12,39 @@
|
||||
|
||||
<para>This section is optional. If the intended user is not a
|
||||
programmer and does not plan to do
|
||||
any debugging on the system software, the system size can be decreased
|
||||
by about 2 GB by removing the debugging symbols and unneeded symbol table
|
||||
entries from binaries and libraries. This causes no inconvenience other
|
||||
than not being able to debug the software fully anymore.</para>
|
||||
any debugging of the system software, the system's size can be decreased
|
||||
by some 2 GB by removing the debugging symbols, and some unnecessary symbol table
|
||||
entries, from binaries and libraries. This causes no real inconvenience for
|
||||
a typical Linux user.</para>
|
||||
|
||||
<para>Most people who use the commands mentioned below do not
|
||||
experience any difficulties. However, it is easy to make a typo and
|
||||
render the new system unusable, so before running the
|
||||
experience any difficulties. However, it is easy to make a mistake and
|
||||
render the new system unusable. So before running the
|
||||
<command>strip</command> commands, it is a good idea to make a
|
||||
backup of the LFS system in its current state.</para>
|
||||
|
||||
<para>A <command>strip</command> command with
|
||||
<para>A <command>strip</command> command with the
|
||||
<parameter>--strip-unneeded</parameter> option removes all debug symbols
|
||||
from a binary or library. And, it removes all symbol table entries not
|
||||
from a binary or library. It also removes all symbol table entries not
|
||||
needed by the linker (for static libraries) or dynamic linker (for
|
||||
dynamic-linked binaries and shared libraries).</para>
|
||||
dynamically linked binaries and shared libraries).</para>
|
||||
|
||||
<para>The debugging symbols for selected libraries are placed
|
||||
in separate files. This debugging information is needed if running
|
||||
regression tests that use <ulink
|
||||
<para>The debugging symbols from selected libraries are preserved
|
||||
in separate files. That debugging information is needed to run
|
||||
regression tests with <ulink
|
||||
url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink
|
||||
url='&blfs-book;/general/gdb.html'>gdb</ulink> later in BLFS.
|
||||
url='&blfs-book;/general/gdb.html'>gdb</ulink> later, in BLFS.
|
||||
</para>
|
||||
|
||||
<para>Note that <command>strip</command> will overwrite the binary or library
|
||||
file it is processing. This can crash the processes using code or data from
|
||||
the file. If the process running <command>strip</command> itself is
|
||||
affected, the binary or library being stripped can be destroyed and can
|
||||
make the system completely unusable. To avoid it, we'll copy some libraries
|
||||
the file. If the process running <command>strip</command> is
|
||||
affected, the binary or library being stripped can be destroyed; this can
|
||||
make the system completely unusable. To avoid this problem we copy some libraries
|
||||
and binaries into <filename class="directory">/tmp</filename>, strip them
|
||||
there, and install them back with the <command>install</command> command.
|
||||
Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> for the
|
||||
rationale to use the <command>install</command> command here.</para>
|
||||
there, then reinstall them with the <command>install</command> command.
|
||||
(The related entry in <xref linkend="pkgmgmt-upgrade-issues"/> gives the
|
||||
rationale for using the <command>install</command> command here.)</para>
|
||||
|
||||
<note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems
|
||||
and ld-linux.so.2 on 32-bit systems. The construct below selects the
|
||||
@ -160,8 +160,8 @@ done</userinput><userinput>
|
||||
unset BIN LIB save_usrlib online_usrbin online_usrlib
|
||||
</userinput></screen>
|
||||
|
||||
<para>A large number of files will be reported as having their file
|
||||
format not recognized. These warnings can be safely ignored. They
|
||||
indicate that those files are scripts instead of binaries.</para>
|
||||
<para>A large number of files will be flagged as errors because their file
|
||||
format is not recognized. These warnings can be safely ignored. They
|
||||
indicate that those files are scripts, not binaries.</para>
|
||||
|
||||
</sect1>
|
||||
|
Loading…
Reference in New Issue
Block a user