glibc.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. <sect1info condition="script">
  10. <productname>glibc</productname>
  11. <productnumber>&glibc-version;</productnumber>
  12. <address>&glibc-url;</address>
  13. </sect1info>
  14. <title>Glibc-&glibc-version;</title>
  15. <indexterm zone="ch-tools-glibc">
  16. <primary sortas="a-Glibc">Glibc</primary>
  17. <secondary>tools</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  22. href="../chapter06/glibc.xml"
  23. xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  24. <segmentedlist>
  25. <segtitle>&buildtime;</segtitle>
  26. <segtitle>&diskspace;</segtitle>
  27. <seglistitem>
  28. <seg>&glibc-ch5-sbu;</seg>
  29. <seg>&glibc-ch5-du;</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>Installation of Glibc</title>
  35. <para>Though not mandatory in this chapter, if you plan on running the test
  36. suite, you should apply the following patches:</para>
  37. <screen><userinput remap="pre">patch -Np1 -i &glibc-iconv-test-fixes-patch;
  38. patch -Np1 -i &glibc-ildoubl-test-fix-patch;</userinput></screen>
  39. <para>The Glibc documentation recommends building Glibc outside of the source
  40. directory in a dedicated build directory:</para>
  41. <screen><userinput remap="pre">mkdir -v ../glibc-build
  42. cd ../glibc-build</userinput></screen>
  43. <para>Because Glibc no longer supports i386, its developers say to use the
  44. compiler flag <parameter>-march=i486</parameter> when building it for x86
  45. machines. There are several ways to accomplish that, but testing shows that
  46. the flag is best placed inside the build variable <quote>CFLAGS</quote>.
  47. Instead of overriding completely what Glibc's internal build system uses
  48. for CFLAGS, append the new flag to the existing contents of CFLAGS by
  49. making use of the special file <filename>configparms</filename>. The
  50. -mtune=native flag is also necessary to reset a reasonable value for -mtune
  51. that is changed when setting -march.</para>
  52. <screen><userinput remap="configure">echo "CFLAGS += -march=i486 -mtune=native" &gt; configparms</userinput></screen>
  53. <para>Next, prepare Glibc for compilation:</para>
  54. <screen><userinput remap="configure">../glibc-&glibc-version;/configure --prefix=/tools \
  55. --disable-profile --enable-add-ons \
  56. --enable-kernel=2.6.0 --with-binutils=/tools/bin \
  57. --without-gd --with-headers=/tools/include \
  58. --without-selinux</userinput></screen>
  59. <variablelist>
  60. <title>The meaning of the configure options:</title>
  61. <varlistentry>
  62. <term><parameter>--disable-profile</parameter></term>
  63. <listitem>
  64. <para>This builds the libraries without profiling information. Omit
  65. this option if profiling on the temporary tools is necessary.</para>
  66. </listitem>
  67. </varlistentry>
  68. <varlistentry>
  69. <term><parameter>--enable-add-ons</parameter></term>
  70. <listitem>
  71. <para>This tells Glibc to use the NPTL add-on as its threading
  72. library.</para>
  73. </listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>--enable-kernel=2.6.0</parameter></term>
  77. <listitem>
  78. <para>This tells Glibc to compile the library with support
  79. for 2.6.x Linux kernels.</para>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry>
  83. <term><parameter>--with-binutils=/tools/bin</parameter></term>
  84. <listitem>
  85. <para>While not required, this switch ensures that there are
  86. no errors pertaining to which Binutils programs get used during the
  87. Glibc build.</para>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry>
  91. <term><parameter>--without-gd</parameter></term>
  92. <listitem>
  93. <para>This prevents the build of the <command>memusagestat</command>
  94. program, which insists on linking against the host's libraries
  95. (libgd, libpng, libz, etc.).</para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term><parameter>--with-headers=/tools/include</parameter></term>
  100. <listitem>
  101. <para>This tells Glibc to compile itself against the headers recently
  102. installed to the tools directory, so that it knows exactly what
  103. features the kernel has and can optimize itself accordingly.</para>
  104. </listitem>
  105. </varlistentry>
  106. <varlistentry>
  107. <term><parameter>--without-selinux</parameter></term>
  108. <listitem>
  109. <para>When building from hosts that include SELinux functionality
  110. (e.g., Fedora Core 3), Glibc will build with support for SELinux.
  111. As the LFS tools environment does not contain support for SELinux, a
  112. Glibc compiled with such support will fail to operate correctly.</para>
  113. </listitem>
  114. </varlistentry>
  115. </variablelist>
  116. <para>During this stage the following warning might appear:</para>
  117. <blockquote>
  118. <screen><computeroutput>configure: WARNING:
  119. *** These auxiliary programs are missing or
  120. *** incompatible versions: msgfmt
  121. *** some features will be disabled.
  122. *** Check the INSTALL file for required versions.</computeroutput></screen>
  123. </blockquote>
  124. <para>The missing or incompatible <command>msgfmt</command> program is
  125. generally harmless, but it can sometimes cause issues when running the
  126. test suite. This <command>msgfmt</command> program is part of the
  127. Gettext package which the host distribution should provide. If
  128. <command>msgfmt</command> is present but deemed incompatible, upgrade
  129. the host system's Gettext package or continue without it and see if
  130. the test suite runs without problems regardless.</para>
  131. <para>Compile the package:</para>
  132. <screen><userinput remap="make">make</userinput></screen>
  133. <para>Compilation is now complete. As mentioned earlier, running the
  134. test suites for the temporary tools installed in this chapter is not
  135. mandatory. To run the Glibc test suite (if desired), the following
  136. commands will do so:</para>
  137. <screen><userinput remap="test">cp -v ../glibc-&glibc-version;/iconvdata/gconv-modules iconvdata
  138. make check</userinput></screen>
  139. <para>For a discussion of test failures that are of particular
  140. importance, please see <xref linkend="ch-system-glibc" role="."/></para>
  141. <para>In this chapter, some tests can be adversely affected by
  142. existing tools or environmental issues on the host system. Glibc test
  143. suite failures in this chapter are typically not worrisome. The Glibc
  144. installed in <xref linkend="chapter-building-system"/> is the one that
  145. will ultimately end up being used, so that is the one that needs to pass
  146. most tests (even in <xref linkend="chapter-building-system"/>, some
  147. failures could still occur, for example, with the math tests).</para>
  148. <para>When experiencing a failure, make a note of it, then continue by
  149. reissuing the <command>make check</command> command. The test suite
  150. should pick up where it left off and continue. This stop-start sequence
  151. can be circumvented by issuing a <command>make -k check</command> command.
  152. If using this option, be sure to log the output so that the log file can
  153. be examined for failures later.</para>
  154. <para>The install stage of Glibc will issue a harmless warning at the
  155. end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
  156. Prevent this warning with:</para>
  157. <screen><userinput remap="install">mkdir -v /tools/etc
  158. touch /tools/etc/ld.so.conf</userinput></screen>
  159. <para>Install the package:</para>
  160. <screen><userinput remap="install">make install</userinput></screen>
  161. <para>Different countries and cultures have varying conventions for
  162. how to communicate. These conventions range from the format for
  163. representing dates and times to more complex issues, such as the
  164. language spoken. The <quote>internationalization</quote> of GNU
  165. programs works by locale.</para>
  166. <note>
  167. <para>If the test suites are not being run in this chapter (as per
  168. the recommendation), there is no need to install the locales now.
  169. The appropriate locales will be installed in the next chapter.
  170. To install the Glibc locales anyway, use instructions from
  171. <xref linkend="ch-system-glibc" role="."/></para>
  172. </note>
  173. </sect2>
  174. <sect2 role="content">
  175. <title/>
  176. <para>Details on this package are located in
  177. <xref linkend="contents-glibc" role="."/></para>
  178. </sect2>
  179. </sect1>