glibc.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-tools-glibc" role="wrap">
  8. <?dbhtml filename="glibc.html"?>
  9. <title>Glibc-&glibc-version;</title>
  10. <indexterm zone="ch-tools-glibc">
  11. <primary sortas="a-Glibc">Glibc</primary>
  12. <secondary>tools</secondary>
  13. </indexterm>
  14. <sect2 role="package">
  15. <title/>
  16. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  17. href="../chapter06/glibc.xml"
  18. xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  19. <segmentedlist>
  20. <segtitle>&buildtime;</segtitle>
  21. <segtitle>&diskspace;</segtitle>
  22. <seglistitem>
  23. <seg>11.8 SBU</seg>
  24. <seg>454 MB</seg>
  25. </seglistitem>
  26. </segmentedlist>
  27. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  28. href="../chapter06/glibc.xml"
  29. xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Glibc</title>
  33. <para>The Glibc documentation recommends building Glibc outside of the source
  34. directory in a dedicated build directory:</para>
  35. <screen><userinput>mkdir -v ../glibc-build
  36. cd ../glibc-build</userinput></screen>
  37. <para>Next, prepare Glibc for compilation:</para>
  38. <screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
  39. --disable-profile --enable-add-ons \
  40. --enable-kernel=2.6.0 --with-binutils=/tools/bin \
  41. --without-gd --with-headers=/tools/include \
  42. --without-selinux</userinput></screen>
  43. <variablelist>
  44. <title>The meaning of the configure options:</title>
  45. <varlistentry>
  46. <term><parameter>--disable-profile</parameter></term>
  47. <listitem>
  48. <para>This builds the libraries without profiling information. Omit
  49. this option if profiling on the temporary tools is necessary.</para>
  50. </listitem>
  51. </varlistentry>
  52. <varlistentry>
  53. <term><parameter>--enable-add-ons</parameter></term>
  54. <listitem>
  55. <para>This tells Glibc to use the NPTL add-on as its threading
  56. library.</para>
  57. </listitem>
  58. </varlistentry>
  59. <varlistentry>
  60. <term><parameter>--enable-kernel=2.6.0</parameter></term>
  61. <listitem>
  62. <para>This tells Glibc to compile the library with support
  63. for 2.6.x Linux kernels.</para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry>
  67. <term><parameter>--with-binutils=/tools/bin</parameter></term>
  68. <listitem>
  69. <para>While not required, this switch ensures that there are
  70. no errors pertaining to which Binutils programs get used during the
  71. Glibc build.</para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term><parameter>--without-gd</parameter></term>
  76. <listitem>
  77. <para>This prevents the build of the <command>memusagestat</command>
  78. program, which insists on linking against the host's libraries
  79. (libgd, libpng, libz, etc.).</para>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry>
  83. <term><parameter>--with-headers=/tools/include</parameter></term>
  84. <listitem>
  85. <para>This tells Glibc to compile itself against the headers recently
  86. installed to the tools directory, so that it knows exactly what
  87. features the kernel has and can optimize itself accordingly.</para>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry>
  91. <term><parameter>--without-selinux</parameter></term>
  92. <listitem>
  93. <para>When building from hosts that include SELinux functionality
  94. (e.g., Fedora Core 3), Glibc will build with support for SELinux.
  95. As the LFS tools environment does not contain support for SELinux, a
  96. Glibc compiled with such support will fail to operate correctly.</para>
  97. </listitem>
  98. </varlistentry>
  99. </variablelist>
  100. <para>During this stage the following warning might appear:</para>
  101. <blockquote>
  102. <screen><computeroutput>configure: WARNING:
  103. *** These auxiliary programs are missing or
  104. *** incompatible versions: msgfmt
  105. *** some features will be disabled.
  106. *** Check the INSTALL file for required versions.</computeroutput></screen>
  107. </blockquote>
  108. <para>The missing or incompatible <command>msgfmt</command> program is
  109. generally harmless, but it can sometimes cause issues when running the
  110. test suite. This <command>msgfmt</command> program is part of the
  111. Gettext package which the host distribution should provide. If
  112. <command>msgfmt</command> is present but deemed incompatible, upgrade
  113. the host system's Gettext package or continue without it and see if
  114. the test suite runs without problems regardless.</para>
  115. <para>Compile the package:</para>
  116. <screen><userinput>make</userinput></screen>
  117. <para>Compilation is now complete. As mentioned earlier, running the
  118. test suites for the temporary tools installed in this chapter is not
  119. mandatory. To run the Glibc test suite (if desired), the following
  120. command will do so:</para>
  121. <screen><userinput>make check</userinput></screen>
  122. <para>For a discussion of test failures that are of particular
  123. importance, please see <xref linkend="ch-system-glibc" role="."/></para>
  124. <para>In this chapter, some tests can be adversely affected by
  125. existing tools or environmental issues on the host system. Glibc test
  126. suite failures in this chapter are typically not worrisome. The Glibc
  127. installed in <xref linkend="chapter-building-system"/> is the one that
  128. will ultimately end up being used, so that is the one that needs to pass
  129. most tests (even in <xref linkend="chapter-building-system"/>, some
  130. failures could still occur, for example, with the math tests).</para>
  131. <para>When experiencing a failure, make a note of it, then continue by
  132. reissuing the <command>make check</command> command. The test suite
  133. should pick up where it left off and continue. This stop-start sequence
  134. can be circumvented by issuing a <command>make -k check</command> command.
  135. If using this option, be sure to log the output so that the log file can
  136. be examined for failures later.</para>
  137. <para>The install stage of Glibc will issue a harmless warning at the
  138. end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
  139. Prevent this warning with:</para>
  140. <screen><userinput>mkdir -v /tools/etc
  141. touch /tools/etc/ld.so.conf</userinput></screen>
  142. <para>Install the package:</para>
  143. <screen><userinput>make install</userinput></screen>
  144. <para>Different countries and cultures have varying conventions for
  145. how to communicate. These conventions range from the format for
  146. representing dates and times to more complex issues, such as the
  147. language spoken. The <quote>internationalization</quote> of GNU
  148. programs works by locale.</para>
  149. <note>
  150. <para>If the test suites are not being run in this chapter (as per
  151. the recommendation), there is no need to install the locales now.
  152. The appropriate locales will be installed in the next chapter.
  153. To install the Glibc locales anyway, use instructions from
  154. <xref linkend="ch-system-glibc" role="."/></para>
  155. </note>
  156. </sect2>
  157. <sect2 role="content">
  158. <title/>
  159. <para>Details on this package are located in
  160. <xref linkend="contents-glibc" role="."/></para>
  161. </sect2>
  162. </sect1>