glibc.xml 8.9 KB

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