glibc.xml 8.0 KB

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