glibc-pass2-inst.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. Now that everything needed to install the Glibc
  19. linuxthreads man pages is present as well, we will install those too.</para>
  20. <para>Before starting to install Glibc, you must cd into the
  21. glibc-&glibc-version; directory and unpack glibc-linuxthreads inside
  22. the glibc-&glibc-version; directory, not in /usr/src as you normally
  23. would do.</para>
  24. <para>This package is known to behave badly when you have changed its
  25. default optimization flags (including the -march and -mcpu options).
  26. Therefore, if you have defined any environment variables that override
  27. default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
  28. or modifying them when building Glibc. You have been warned.</para>
  29. <para>Basically, compiling Glibc in any other way than the book suggests
  30. is putting your system at very high risk.</para>
  31. <para>It is recommended by the Glibc installation documentation to build
  32. Glibc outside of the source tree. Create the build directory:</para>
  33. <para><screen><userinput>mkdir ../glibc-build &amp;&amp;
  34. cd ../glibc-build</userinput></screen></para>
  35. <para>Next, prepare Glibc to be compiled:</para>
  36. <para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr --disable-profile \
  37. &nbsp;&nbsp;&nbsp;&nbsp;--enable-add-ons --libexecdir=/usr/bin</userinput></screen></para>
  38. <para>Continue with compiling the package:</para>
  39. <para><screen><userinput>make</userinput></screen></para>
  40. <para>Begin package installation:</para>
  41. <para><screen><userinput>make install</userinput></screen></para>
  42. <para>Build the linuxthreads man pages:</para>
  43. <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man</userinput></screen></para>
  44. <para>Install the man pages:</para>
  45. <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen></para>
  46. <para>Complete package installation by relaunching bash:</para>
  47. <para><screen><userinput>exec /bin/bash --login</userinput></screen></para>
  48. </sect2>