stripping.xml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-tools-stripping">
  7. <title>Stripping</title>
  8. <?dbhtml filename="stripping.html"?>
  9. <para>The steps in this section are optional, but if your LFS partition is
  10. rather small, you will be glad to learn that you can remove some unnecessary
  11. things. The executables and libraries you have built so far contain about 130
  12. MB of unneeded debugging symbols. Remove those symbols with:</para>
  13. <screen><userinput>strip --strip-debug /tools/lib/*
  14. strip --strip-unneeded /tools/{,s}bin/*</userinput></screen>
  15. <para>The last 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
  17. of binaries.</para>
  18. <para>Take care <emphasis>not</emphasis> to use
  19. <parameter>--strip-unneeded</parameter> on the libraries -- the static ones
  20. would be destroyed and you would have to build the three toolchain packages
  21. all over again.</para>
  22. <para>To save another 30 MB, you can remove all the documentation:</para>
  23. <screen><userinput>rm -rf /tools/{doc,info,man}</userinput></screen>
  24. <para>You will now need to have at least 850 MB of free space on your LFS
  25. file system to be able to build and install Glibc in the next phase. If you can
  26. build and install Glibc, you can build and install the rest too.</para>
  27. </sect1>