1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3CR2//EN" "http://www.docbook.org/xml/4.3CR2/docbookx.dtd">
3 <sect1 id="ch05-stripping">
4 <title>Stripping</title>
5 <?dbhtml filename="stripping.html"?>
7 <para>The steps in this section are optional. If your LFS partition is rather
8 small, you will be glad to learn that you can throw away some unnecessary
9 things. The executables and libraries you have built so far contain about 130 MB
10 of unneeded debugging symbols. Remove those symbols like this:</para>
12 <screen><userinput>strip --strip-unneeded /tools/{,s}bin/*
13 strip --strip-debug /tools/lib/*</userinput></screen>
15 <para>The first of the above commands will skip some twenty files, reporting
16 that it doesn't recognize their file format. Most of them are scripts instead
19 <para>Take care <emphasis>not</emphasis> to use
20 <userinput>--strip-unneeded</userinput> on the libraries -- they would be
21 destroyed and you would have to build Glibc all over again.</para>
23 <para>To save another couple of megabytes, you can throw away all the
26 <screen><userinput>rm -rf /tools/{,share/}{doc,info,man}</userinput></screen>
28 <para>You will now need to have at least 850 MB of free space on your LFS
29 filesystem to be able to build and install Glibc in the next phase. If you can
30 build and install Glibc, you can build and install the rest too.</para>