glibc-pass2-inst.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of Glibc</title>
  4. <para>At the beginning of this chapter you installed Glibc and applied a
  5. patch to it. Part of this patch was undoing some changes to make static
  6. binaries compiled against Glibc-2.2 work. However, this is not what the
  7. Glibc developers intended and we don't need to keep this modified Glibc
  8. around. So we reinstall Glibc here to remove this patch.</para>
  9. <para>A second reason to install Glibc again is because it's considered
  10. cleaner. The first Glibc was installed using programs compiled on your host
  11. distribution which sometimes has the effect of tainting Glibc. While this
  12. isn't a problem with the other packages compiled early in this chapter, for
  13. Glibc we want to be sure it's 100% OK (although feel free to reinstall
  14. other packages at this point so you can say you compiled an LFS system with
  15. LFS. Much like GCC's bootstrap installation method).</para>
  16. <para>We'll also install the linuxthreads man pages here. As you may
  17. recall, during the first installation of Glibc this wasn't possible because
  18. Perl wasn't installed yet. Everything we need to install the Glibc
  19. linuxthread man pages is present now, so we'll take care of this too
  20. now.</para>
  21. <para>Before starting to install glibc, you must cd into the
  22. glibc-&glibc-version; directory and unpack glibc-linuxthreads inside
  23. the glibc-&glibc-version; directory, not in /usr/src as you normally
  24. would do.</para>
  25. <para>This package is known to behave badly when you have changed its
  26. default optimization flags (including the -march and -mcpu options). Glibc
  27. is best left alone. Therefore, if you have defined any environment variables
  28. that override default optimizations, such as CFLAGS and CXXFLAGS, we
  29. recommend unsetting or modifying them when building Glibc. You have
  30. been warned.</para>
  31. <para>Basically, compiling Glibc in any other way than the book suggests
  32. is putting your system at very high risk.</para>
  33. <para>It is recommended by the Glibc installation documentation to build
  34. Glibc outside of the source tree. Create the build directory:</para>
  35. <para><screen><userinput>mkdir ../glibc-build &amp;&amp;
  36. cd ../glibc-build</userinput></screen></para>
  37. <para>Next, prepare Glibc to be compiled:</para>
  38. <para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr --disable-profile \
  39. &nbsp;&nbsp;&nbsp;&nbsp;--enable-add-ons --libexecdir=/usr/bin</userinput></screen></para>
  40. <para>Continue with compiling the package:</para>
  41. <para><screen><userinput>make</userinput></screen></para>
  42. <para>Begin package installation:</para>
  43. <para><screen><userinput>make install</userinput></screen></para>
  44. <para>Build the linuxthreads man pages:</para>
  45. <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man</userinput></screen></para>
  46. <para>Install the man pages:</para>
  47. <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen></para>
  48. <para>Complete package installation by relaunching bash:</para>
  49. <para><screen><userinput>exec /bin/bash --login</userinput></screen></para>
  50. </sect2>