- Timestamp:
- 12/20/2022 11:30:12 PM (17 months ago)
- Branches:
- multilib
- Children:
- a8de3b44
- Parents:
- 101d00d (diff), 9c753b58 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- chapter08
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter08/aboutdebug.xml
r101d00d r47c0603 18 18 the names of the routines and variables.</para> 19 19 20 <para> However, the inclusion of these debugging symbols enlarges a21 program or library significantly. The following is an exampleof the20 <para>The inclusion of these debugging symbols enlarges a 21 program or library significantly. Here are two examples of the 22 22 amount of space these symbols occupy:</para> 23 23 … … 29 29 <listitem> 30 30 <para>A <command>bash</command> binary without debugging symbols: 31 480 KB </para>31 480 KB (60% smaller)</para> 32 32 </listitem> 33 33 <listitem> … … 37 37 </listitem> 38 38 <listitem> 39 <para>Glibc and GCC files without debugging symbols: 16 MB </para>39 <para>Glibc and GCC files without debugging symbols: 16 MB (82% smaller)</para> 40 40 </listitem> 41 41 </itemizedlist> 42 42 43 <para>Sizes may vary depending on which compiler and C library were used, 44 but when comparing programs with and without debugging symbols, the 45 difference will usually be a factor between two and five.</para> 46 47 <para>Because most users will never use a debugger on their system software, 43 <para>Sizes will vary depending on which compiler and C library were used, 44 but a program that has been stripped of debugging symbols is usually some 45 50% to 80% smaller than its unstripped counterpart. 46 Because most users will never use a debugger on their system software, 48 47 a lot of disk space can be regained by removing these symbols. The next 49 48 section shows how to strip all debugging symbols from the programs and -
chapter08/cleanup.xml
r101d00d r47c0603 11 11 <title>Cleaning Up</title> 12 12 13 <para>Finally, clean up some extra files left aroundfrom running tests:</para>13 <para>Finally, clean up some extra files left over from running tests:</para> 14 14 15 15 <screen><userinput>rm -rf /tmp/*</userinput></screen> 16 16 17 <para>There are also several files in stalled inthe /usr/lib and /usr/libexec17 <para>There are also several files in the /usr/lib and /usr/libexec 18 18 directories with a file name extension of .la. These are "libtool archive" 19 files. As already said, on a modern Linux system the libtool .la files are19 files. On a modern Linux system the libtool .la files are 20 20 only useful for libltdl. No libraries in LFS are expected to be loaded 21 by libltdl, and it's known that some .la files can cause BLFS packages22 fail to build. Remove those files now:</para>21 by libltdl, and it's known that some .la files can break BLFS package 22 builds. Remove those files now:</para> 23 23 24 24 <screen><userinput>find /usr/lib /usr/libexec -name \*.la -delete</userinput><userinput arch="ml_32,ml_all"> -
chapter08/stripping.xml
r101d00d r47c0603 13 13 <para>This section is optional. If the intended user is not a 14 14 programmer and does not plan to do 15 any debugging o n the system software, the systemsize can be decreased16 by about 2 GB by removing the debugging symbols and unneededsymbol table17 entries from binaries and libraries. This causes no inconvenience other18 than not being able to debug the software fully anymore.</para>15 any debugging of the system software, the system's size can be decreased 16 by some 2 GB by removing the debugging symbols, and some unnecessary symbol table 17 entries, from binaries and libraries. This causes no real inconvenience for 18 a typical Linux user.</para> 19 19 20 20 <para>Most people who use the commands mentioned below do not 21 experience any difficulties. However, it is easy to make a typoand22 render the new system unusable , so before running the21 experience any difficulties. However, it is easy to make a mistake and 22 render the new system unusable. So before running the 23 23 <command>strip</command> commands, it is a good idea to make a 24 24 backup of the LFS system in its current state.</para> 25 25 26 <para>A <command>strip</command> command with 26 <para>A <command>strip</command> command with the 27 27 <parameter>--strip-unneeded</parameter> option removes all debug symbols 28 from a binary or library. And, itremoves all symbol table entries not28 from a binary or library. It also removes all symbol table entries not 29 29 needed by the linker (for static libraries) or dynamic linker (for 30 dynamic -linked binaries and shared libraries).</para>30 dynamically linked binaries and shared libraries).</para> 31 31 32 <para>The debugging symbols f or selected libraries are placed33 in separate files. Th is debugging information is needed if running34 regression tests that use<ulink32 <para>The debugging symbols from selected libraries are preserved 33 in separate files. That debugging information is needed to run 34 regression tests with <ulink 35 35 url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink 36 url='&blfs-book;/general/gdb.html'>gdb</ulink> later in BLFS.36 url='&blfs-book;/general/gdb.html'>gdb</ulink> later, in BLFS. 37 37 </para> 38 38 39 39 <para>Note that <command>strip</command> will overwrite the binary or library 40 40 file it is processing. This can crash the processes using code or data from 41 the file. If the process running <command>strip</command> i tself is42 affected, the binary or library being stripped can be destroyed andcan43 make the system completely unusable. To avoid it, we'llcopy some libraries41 the file. If the process running <command>strip</command> is 42 affected, the binary or library being stripped can be destroyed; this can 43 make the system completely unusable. To avoid this problem we copy some libraries 44 44 and binaries into <filename class="directory">/tmp</filename>, strip them 45 there, and install them backwith the <command>install</command> command.46 Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> forthe47 rationale to use the <command>install</command> command here.</para>45 there, then reinstall them with the <command>install</command> command. 46 (The related entry in <xref linkend="pkgmgmt-upgrade-issues"/> gives the 47 rationale for using the <command>install</command> command here.)</para> 48 48 49 49 <note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems … … 161 161 </userinput></screen> 162 162 163 <para>A large number of files will be reported as havingtheir file164 format not recognized. These warnings can be safely ignored. They165 indicate that those files are scripts instead ofbinaries.</para>163 <para>A large number of files will be flagged as errors because their file 164 format is not recognized. These warnings can be safely ignored. They 165 indicate that those files are scripts, not binaries.</para> 166 166 167 167 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.