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