glibc.xml 7.6 KB

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