[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[1770019] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[673b0d8] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
[3e36a78] | 4 | <!ENTITY % patches-entities SYSTEM "../patches.ent">
|
---|
[673b0d8] | 5 | %general-entities;
|
---|
[3e36a78] | 6 | %patches-entities;
|
---|
[673b0d8] | 7 | ]>
|
---|
[9652249] | 8 | <sect1 id="ch-tools-glibc" role="wrap">
|
---|
[673b0d8] | 9 | <title>Glibc-&glibc-version;</title>
|
---|
| 10 | <?dbhtml filename="glibc.html"?>
|
---|
[bc82645e] | 11 |
|
---|
[81fd230] | 12 | <indexterm zone="ch-tools-glibc">
|
---|
| 13 | <primary sortas="a-Glibc">Glibc</primary>
|
---|
| 14 | <secondary>tools</secondary></indexterm>
|
---|
| 15 |
|
---|
[9652249] | 16 | <sect2 role="package"><title/>
|
---|
[81fd230] | 17 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
---|
[673b0d8] | 18 |
|
---|
[9652249] | 19 | <segmentedlist>
|
---|
| 20 | <segtitle>&buildtime;</segtitle>
|
---|
| 21 | <segtitle>&diskspace;</segtitle>
|
---|
[fad7667] | 22 | <seglistitem><seg>11.8 SBU</seg><seg>454 MB</seg></seglistitem>
|
---|
[9652249] | 23 | </segmentedlist>
|
---|
[673b0d8] | 24 |
|
---|
[81fd230] | 25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
|
---|
| 26 |
|
---|
[9652249] | 27 | </sect2>
|
---|
[73aedd1d] | 28 |
|
---|
[9652249] | 29 | <sect2 role="installation">
|
---|
[5888299] | 30 | <title>Installation of Glibc</title>
|
---|
[73aedd1d] | 31 |
|
---|
[81fd230] | 32 | <para>This package is known to have issues when its default
|
---|
| 33 | optimization flags (including the <parameter>-march</parameter> and
|
---|
| 34 | <parameter>-mcpu</parameter> options) are changed. If any environment
|
---|
| 35 | variables that override default optimizations have been defined, such
|
---|
| 36 | as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
|
---|
| 37 | unset them when building Glibc.</para>
|
---|
| 38 |
|
---|
| 39 | <para>It should be noted that compiling Glibc in any way other than
|
---|
| 40 | the method suggested in this book puts the stability of the system at
|
---|
| 41 | risk.</para>
|
---|
| 42 |
|
---|
[c3bb6d8] | 43 | <para>Glibc has two tests which fail when the running kernel is 2.6.11.x The
|
---|
| 44 | problem has been determined to be with the tests themselves, not with the libc
|
---|
| 45 | nor the kernel. If you plan to run the testsuite apply this patch:</para>
|
---|
| 46 |
|
---|
[3e36a78] | 47 | <screen><userinput>patch -Np1 -i ../&glibc-testfix-patch;</userinput></screen>
|
---|
[c3bb6d8] | 48 |
|
---|
[81fd230] | 49 | <para>The Glibc documentation recommends building Glibc outside of the source
|
---|
| 50 | directory in a dedicated build directory:</para>
|
---|
[3d36131c] | 51 |
|
---|
[73aedd1d] | 52 | <screen><userinput>mkdir ../glibc-build
|
---|
| 53 | cd ../glibc-build</userinput></screen>
|
---|
| 54 |
|
---|
[d27a27b] | 55 | <para>Next, prepare Glibc for compilation:</para>
|
---|
[73aedd1d] | 56 |
|
---|
[9dfc02f] | 57 | <screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
[084db8d] | 58 | --disable-profile --enable-add-ons \
|
---|
| 59 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
[8e97f32] | 60 | --without-gd --with-headers=/tools/include \
|
---|
[3d31fc4] | 61 | --without-selinux</userinput></screen>
|
---|
[73aedd1d] | 62 |
|
---|
[81fd230] | 63 | <para>The meaning of the configure options:</para>
|
---|
| 64 |
|
---|
| 65 | <variablelist>
|
---|
| 66 | <varlistentry>
|
---|
| 67 | <term><parameter>--disable-profile</parameter></term>
|
---|
| 68 | <listitem><para>This builds the libraries without profiling
|
---|
| 69 | information. Omit this option if profiling on the temporary tools is
|
---|
| 70 | necessary.</para></listitem>
|
---|
| 71 | </varlistentry>
|
---|
| 72 |
|
---|
| 73 | <varlistentry>
|
---|
| 74 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
| 75 | <listitem><para>This tells Glibc to use the NPTL add-on as its threading
|
---|
| 76 | library.</para></listitem>
|
---|
| 77 | </varlistentry>
|
---|
| 78 |
|
---|
| 79 | <varlistentry>
|
---|
| 80 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
| 81 | <listitem><para>This tells Glibc to compile the library with support
|
---|
| 82 | for 2.6.x Linux kernels.</para></listitem>
|
---|
| 83 | </varlistentry>
|
---|
| 84 |
|
---|
| 85 | <varlistentry>
|
---|
| 86 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
| 87 | <listitem><para>While not required, this switch ensures that there are
|
---|
| 88 | no errors pertaining to which Binutils programs get used during the
|
---|
| 89 | Glibc build.</para></listitem>
|
---|
| 90 | </varlistentry>
|
---|
| 91 |
|
---|
| 92 | <varlistentry>
|
---|
| 93 | <term><parameter>--without-gd</parameter></term>
|
---|
| 94 | <listitem><para>This prevents the build of the
|
---|
| 95 | <command>memusagestat</command> program, which insists on linking
|
---|
| 96 | against the host's libraries (libgd, libpng, libz,
|
---|
| 97 | etc.).</para></listitem>
|
---|
| 98 | </varlistentry>
|
---|
| 99 |
|
---|
| 100 | <varlistentry>
|
---|
| 101 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
| 102 | <listitem><para>This tells Glibc to compile itself against the headers recently
|
---|
| 103 | installed to the tools directory, so that it knows exactly what features the
|
---|
| 104 | kernel has and can optimize itself accordingly.</para></listitem>
|
---|
| 105 | </varlistentry>
|
---|
| 106 |
|
---|
| 107 | <varlistentry>
|
---|
[3d31fc4] | 108 | <term><parameter>--without-selinux</parameter></term>
|
---|
[663ecfc] | 109 | <listitem><para>When building from hosts that include SELinux functionality
|
---|
| 110 | (e.g. Fedora Core 3), Glibc will build with support for SELinux. As the LFS
|
---|
| 111 | tools environment does not contain support for SELinux, a Glibc compiled with
|
---|
| 112 | such support will fail to operate correctly.</para></listitem>
|
---|
[81fd230] | 113 | </varlistentry>
|
---|
| 114 | </variablelist>
|
---|
| 115 |
|
---|
| 116 | <para>During this stage the following warning might appear:</para>
|
---|
| 117 |
|
---|
| 118 | <blockquote><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></blockquote>
|
---|
| 123 |
|
---|
| 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 |
|
---|
[73aedd1d] | 132 | <para>Compile the package:</para>
|
---|
| 133 |
|
---|
| 134 | <screen><userinput>make</userinput></screen>
|
---|
| 135 |
|
---|
[81fd230] | 136 | <para>Compilation is now complete. As mentioned earlier, running the
|
---|
| 137 | test suites for the temporary tools installed in this chapter is not
|
---|
| 138 | mandatory. To run the Glibc test suite (if desired), the following
|
---|
| 139 | command will do so:</para>
|
---|
[3d36131c] | 140 |
|
---|
[73aedd1d] | 141 | <screen><userinput>make check</userinput></screen>
|
---|
| 142 |
|
---|
[d878ce3] | 143 | <para>For a discussion of test failures that are of particular
|
---|
[81fd230] | 144 | importance, please see <xref linkend="ch-system-glibc" role="."/></para>
|
---|
| 145 |
|
---|
[296762cd] | 146 | <para>In this chapter, some tests can be adversely affected by
|
---|
[81fd230] | 147 | existing tools or environmental issues on the host system. Glibc test
|
---|
| 148 | suite failures in this chapter are typically not worrisome. The Glibc
|
---|
| 149 | installed in <xref linkend="chapter-building-system"/> is the one that
|
---|
| 150 | will ultimately end up being used, so that is the one that needs to pass
|
---|
| 151 | most tests (even in <xref linkend="chapter-building-system"/>, some
|
---|
| 152 | failures could still occur, for example, with the math tests).</para>
|
---|
| 153 |
|
---|
| 154 | <para>When experiencing a failure, make a note of it, then continue by
|
---|
| 155 | reissuing the <command>make check</command> command. The test suite should pick up where it left
|
---|
| 156 | off and continue. This stop-start sequence can be circumvented by
|
---|
| 157 | issuing a <command>make -k check</command> command. If using this option, be sure to log the
|
---|
| 158 | output so that the log file can be examined for failures later.</para>
|
---|
| 159 |
|
---|
| 160 | <para>The install stage of Glibc will issue a harmless warning at the
|
---|
| 161 | end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
| 162 | Prevent this warning with:</para>
|
---|
[d878ce3] | 163 |
|
---|
[1caa48e] | 164 | <screen><userinput>mkdir /tools/etc
|
---|
| 165 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
| 166 |
|
---|
[81fd230] | 167 | <para>Install the package:</para>
|
---|
[73aedd1d] | 168 |
|
---|
| 169 | <screen><userinput>make install</userinput></screen>
|
---|
| 170 |
|
---|
[81fd230] | 171 | <para>Different countries and cultures have varying conventions for
|
---|
| 172 | how to communicate. These conventions range from the format for
|
---|
| 173 | representing dates and times to more complex issues, such as the
|
---|
| 174 | language spoken. The <quote>internationalization</quote> of GNU
|
---|
| 175 | programs works by locale.</para>
|
---|
| 176 |
|
---|
| 177 | <note><para>If the test suites are not being run in this chapter (as
|
---|
| 178 | per the recommendation), there is no need to install the locales now.
|
---|
| 179 | The appropriate locales will be installed in the next
|
---|
| 180 | chapter.</para></note>
|
---|
| 181 |
|
---|
| 182 | <para>To install the Glibc locales anyway, use the following
|
---|
[fba1478] | 183 | command:</para>
|
---|
[73aedd1d] | 184 |
|
---|
| 185 | <screen><userinput>make localedata/install-locales</userinput></screen>
|
---|
| 186 |
|
---|
[81fd230] | 187 | <para>To save time, an alternative to running the
|
---|
| 188 | previous command (which generates and installs every locale Glibc is
|
---|
| 189 | aware of) is to install only those locales that are wanted and needed.
|
---|
| 190 | This can be achieved by using the <command>localedef</command>
|
---|
| 191 | command. Information on this command is located in the
|
---|
| 192 | <filename>INSTALL</filename> file in the Glibc source. However, there
|
---|
| 193 | are a number of locales that are essential in order for the tests of
|
---|
| 194 | future packages to pass, in particular, the
|
---|
| 195 | <emphasis>libstdc++</emphasis> tests from GCC. The following
|
---|
| 196 | instructions, instead of the <parameter>install-locales</parameter>
|
---|
| 197 | target used above, will install the minimum set of locales necessary
|
---|
[fba1478] | 198 | for the tests to run successfully:</para>
|
---|
[73aedd1d] | 199 |
|
---|
| 200 | <screen><userinput>mkdir -p /tools/lib/locale
|
---|
| 201 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
| 202 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
| 203 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
| 204 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
| 205 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
| 206 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
[efb32ca] | 207 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
[73aedd1d] | 208 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
| 209 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
| 210 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
| 211 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
| 212 |
|
---|
| 213 | </sect2>
|
---|
[bc82645e] | 214 |
|
---|
[81fd230] | 215 | <sect2 role="content"><title/>
|
---|
| 216 | <para>Details on this package are located in <xref
|
---|
| 217 | linkend="contents-glibc" role="."/></para>
|
---|
| 218 | </sect2>
|
---|
| 219 |
|
---|
[bc82645e] | 220 | </sect1>
|
---|
[81fd230] | 221 |
|
---|