aboutsummaryrefslogtreecommitdiffstats
path: root/chapter05/chapter05.xml
diff options
context:
space:
mode:
Diffstat (limited to 'chapter05/chapter05.xml')
-rw-r--r--chapter05/chapter05.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml
index a8369c913..922b125f0 100644
--- a/chapter05/chapter05.xml
+++ b/chapter05/chapter05.xml
@@ -35,5 +35,36 @@
&c5-utillinux;
&c5-perl;
+<sect1 id="ch05-stripping">
+<title>Stripping</title>
+<?dbhtml filename="stripping.html" dir="chapter05"?>
+
+<para>If your LFS partition is rather small, you will be glad to learn that you
+can throw away some unnecessary things. The executables and libraries you have
+built so far contain about 130 MB of unneeded debugging symbols. Remove those
+symbols like this:</para>
+
+<para><screen><userinput>strip --strip-unneeded /stage1/{,s}bin/*
+strip --strip-debug /stage1/lib/*</userinput></screen></para>
+
+<para>The first of the above commands will skip some twenty files, reporting
+that it doesn't recognize their file format. Most of them are scripts instead
+of binaries.</para>
+
+<para>Take care <emphasis>not</emphasis> to use
+<userinput>--strip-unneeded</userinput> on the libraries -- they would be
+destroyed and you would have to build Glibc all over again.</para>
+
+<para>To save another couple of megabytes, you can throw away the documentation
+and some of the bigger unneeded programs:</para>
+
+<para><screen><userinput>rm -r /stage1/share/{doc,info,man}
+rm /stage1/bin/{addr2line,gprof,nm,size,strings,strip}</userinput></screen></para>
+
+<para>You will now need to have at least 700 MB of free space on your LFS
+filesystem to be able to build and install Glibc in the next phase.</para>
+
+</sect1>
+
</chapter>