glibc.xml 7.3 KB

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