[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 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 |
|
---|
[673b0d8] | 10 | <indexterm zone="ch-tools-glibc">
|
---|
| 11 | <primary sortas="a-Glibc">Glibc</primary>
|
---|
| 12 | <secondary>tools</secondary></indexterm>
|
---|
[bc82645e] | 13 |
|
---|
[9652249] | 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])"/>
|
---|
[673b0d8] | 16 |
|
---|
[9652249] | 17 | <segmentedlist>
|
---|
| 18 | <segtitle>&buildtime;</segtitle>
|
---|
| 19 | <segtitle>&diskspace;</segtitle>
|
---|
| 20 | <seglistitem><seg>11.8 SBU</seg><seg>800 MB</seg></seglistitem>
|
---|
| 21 | </segmentedlist>
|
---|
[673b0d8] | 22 |
|
---|
[9652249] | 23 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
|
---|
[73aedd1d] | 24 |
|
---|
[9652249] | 25 | </sect2>
|
---|
[73aedd1d] | 26 |
|
---|
[9652249] | 27 | <sect2 role="installation">
|
---|
[5888299] | 28 | <title>Installation of Glibc</title>
|
---|
[73aedd1d] | 29 |
|
---|
[24a08b9] | 30 | <para>This package is known to have issues when its default
|
---|
[574b0ea] | 31 | optimization flags (including the <parameter>-march</parameter> and
|
---|
[24a08b9] | 32 | <parameter>-mcpu</parameter> options) are changed. If any environment
|
---|
| 33 | variables that override default optimizations have been defined, such
|
---|
[e097438] | 34 | as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
|
---|
[24a08b9] | 35 | unset them when building Glibc.</para>
|
---|
[73aedd1d] | 36 |
|
---|
[6e41459] | 37 | <para>It should be noted that compiling Glibc in any way other than
|
---|
| 38 | the method suggested in this book puts the stability of the system at
|
---|
| 39 | risk.</para>
|
---|
[73aedd1d] | 40 |
|
---|
[2b6c440] | 41 | <para arch="raq2">NPTL is not supported under the MIPS architecture, so we are going to
|
---|
| 42 | remove the nptl directory from the Glibc source:</para>
|
---|
| 43 |
|
---|
[da51ba8] | 44 | <screen arch="raq2"><userinput>rm -rf nptl*</userinput></screen>
|
---|
| 45 |
|
---|
| 46 | <para arch="ppc">NPTL is not supported under the PPC architecture, so we are going to
|
---|
| 47 | remove the nptl directory from the Glibc source:</para>
|
---|
| 48 |
|
---|
| 49 | <screen arch="ppc"><userinput>rm -rf nptl*</userinput></screen>
|
---|
[2b6c440] | 50 |
|
---|
| 51 | <para arch="raq2">This patch fixes a librt linking issue.</para>
|
---|
| 52 |
|
---|
| 53 | <screen arch="raq2"><userinput>patch -Np1 -i ../glibc-&glibc-version;-raq2_librt_linking-1.patch</userinput></screen>
|
---|
| 54 |
|
---|
| 55 | <para arch="raq2">This patch contains all the necessary patches for RaQ2 server.</para>
|
---|
| 56 |
|
---|
| 57 | <screen arch="raq2"><userinput>patch -Np1 -i ../glibc-&glibc-version;-raq2_fixes-1.patch</userinput></screen>
|
---|
| 58 |
|
---|
[73aedd1d] | 59 | <para>The Glibc documentation recommends building Glibc outside of the source
|
---|
| 60 | directory in a dedicated build directory:</para>
|
---|
| 61 |
|
---|
| 62 | <screen><userinput>mkdir ../glibc-build
|
---|
| 63 | cd ../glibc-build</userinput></screen>
|
---|
| 64 |
|
---|
[d27a27b] | 65 | <para>Next, prepare Glibc for compilation:</para>
|
---|
[73aedd1d] | 66 |
|
---|
[9dfc02f] | 67 | <screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
[407d336] | 68 | --disable-profile --enable-add-ons \
|
---|
| 69 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
[07c7a8d] | 70 | --without-gd --without-cvs --with-headers=/tools/include \
|
---|
| 71 | --disable-selinux</userinput></screen>
|
---|
[73aedd1d] | 72 |
|
---|
[38bb44a] | 73 | <beginpage/>
|
---|
[73aedd1d] | 74 | <para>The meaning of the configure options:</para>
|
---|
| 75 |
|
---|
[9652249] | 76 | <variablelist>
|
---|
| 77 | <varlistentry>
|
---|
[574b0ea] | 78 | <term><parameter>--disable-profile</parameter></term>
|
---|
[6e41459] | 79 | <listitem><para>This builds the libraries without profiling
|
---|
| 80 | information. Omit this option if profiling on the temporary tools is
|
---|
| 81 | necessary.</para></listitem>
|
---|
[9652249] | 82 | </varlistentry>
|
---|
| 83 |
|
---|
| 84 | <varlistentry>
|
---|
[407d336] | 85 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
[9652249] | 86 | <listitem><para>This tells Glibc to use the NPTL add-on as its threading
|
---|
| 87 | library.</para></listitem>
|
---|
| 88 | </varlistentry>
|
---|
| 89 |
|
---|
[4fdb55e] | 90 | <varlistentry>
|
---|
| 91 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
[6e41459] | 92 | <listitem><para>This tells Glibc to compile the library with support
|
---|
| 93 | for 2.6.x Linux kernels.</para></listitem>
|
---|
[4fdb55e] | 94 | </varlistentry>
|
---|
| 95 |
|
---|
[9652249] | 96 | <varlistentry>
|
---|
[574b0ea] | 97 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
[6e41459] | 98 | <listitem><para>While not required, this switch ensures that there are
|
---|
| 99 | no errors pertaining to which Binutils programs get used during the
|
---|
[9652249] | 100 | Glibc build.</para></listitem>
|
---|
| 101 | </varlistentry>
|
---|
| 102 |
|
---|
| 103 | <varlistentry>
|
---|
[574b0ea] | 104 | <term><parameter>--without-gd</parameter></term>
|
---|
[6e41459] | 105 | <listitem><para>This prevents the build of the
|
---|
| 106 | <command>memusagestat</command> program, which insists on linking
|
---|
| 107 | against the host's libraries (libgd, libpng, libz,
|
---|
| 108 | etc.).</para></listitem>
|
---|
[9652249] | 109 | </varlistentry>
|
---|
| 110 |
|
---|
| 111 | <varlistentry>
|
---|
[574b0ea] | 112 | <term><parameter>--without-cvs</parameter></term>
|
---|
[69993f4] | 113 | <listitem><para>This prevents the Makefile files from
|
---|
[6e41459] | 114 | attempting automatic CVS checkouts when using a CVS snapshot. While
|
---|
| 115 | this command is not required, it is recommended because it suppresses
|
---|
| 116 | an annoying, but harmless, warning about a missing autoconf
|
---|
| 117 | program.</para></listitem>
|
---|
[9652249] | 118 | </varlistentry>
|
---|
[9dfc02f] | 119 |
|
---|
[9652249] | 120 | <varlistentry>
|
---|
[407d336] | 121 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
| 122 | <listitem><para>This tells Glibc to compile itself against the headers recently
|
---|
| 123 | installed to the tools directory, so that it knows exactly what features the
|
---|
| 124 | kernel has and can optimize itself accordingly.</para></listitem>
|
---|
[9652249] | 125 | </varlistentry>
|
---|
[07c7a8d] | 126 |
|
---|
| 127 | <!-- Edit Me -->
|
---|
| 128 | <varlistentry>
|
---|
| 129 | <term><parameter>--disable-selinux</parameter></term>
|
---|
| 130 | <listitem><para>When building from hosts using SELinux functionality
|
---|
| 131 | (i.e. Fedora Core 3), glibc will try to integrate this functionality into
|
---|
| 132 | itself, but will fail, because we do not have this functionality in the LFS
|
---|
| 133 | tools enviornment. This option will disable this, allowing glibc to build
|
---|
| 134 | correctly, but will not otherwise affect the build.</para></listitem>
|
---|
| 135 | </varlistentry>
|
---|
| 136 | <!-- -->
|
---|
[9652249] | 137 | </variablelist>
|
---|
[73aedd1d] | 138 |
|
---|
[38bb44a] | 139 | <beginpage/>
|
---|
[69993f4] | 140 | <para>During this stage the following warning might appear:</para>
|
---|
[73aedd1d] | 141 |
|
---|
[574b0ea] | 142 | <blockquote><screen><computeroutput>configure: WARNING:
|
---|
[c863747] | 143 | *** These auxiliary programs are missing or
|
---|
| 144 | *** incompatible versions: msgfmt
|
---|
[73aedd1d] | 145 | *** some features will be disabled.
|
---|
[574b0ea] | 146 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
[73aedd1d] | 147 |
|
---|
[ede9b9b] | 148 | <para>The missing or incompatible <command>msgfmt</command> program is
|
---|
[69993f4] | 149 | generally harmless, but it can sometimes cause issues when running the
|
---|
| 150 | test suite. This <command>msgfmt</command> program is part of the
|
---|
| 151 | Gettext package which the host distribution should provide. If
|
---|
| 152 | <command>msgfmt</command> is present but deemed incompatible, upgrade
|
---|
| 153 | the host system's Gettext package or continue without it and see if
|
---|
| 154 | the test suite runs without problems regardless.</para>
|
---|
[73aedd1d] | 155 |
|
---|
| 156 | <para>Compile the package:</para>
|
---|
| 157 |
|
---|
| 158 | <screen><userinput>make</userinput></screen>
|
---|
| 159 |
|
---|
[6e41459] | 160 | <para>Compilation is now complete. As mentioned earlier, running the
|
---|
| 161 | test suites for the temporary tools installed in this chapter is not
|
---|
| 162 | mandatory. To run the Glibc test suite (if desired), the following
|
---|
| 163 | command will do so:</para>
|
---|
[73aedd1d] | 164 |
|
---|
| 165 | <screen><userinput>make check</userinput></screen>
|
---|
| 166 |
|
---|
[d878ce3] | 167 | <para>For a discussion of test failures that are of particular
|
---|
[e097438] | 168 | importance, please see <xref linkend="ch-system-glibc" role="."/></para>
|
---|
[d878ce3] | 169 |
|
---|
[69993f4] | 170 | <para>In this chapter, some tests can be adversely effected by
|
---|
[6e41459] | 171 | existing tools or environmental issues on the host system. Glibc test
|
---|
[69993f4] | 172 | suite failures in this chapter are typically not worrisome. The Glibc
|
---|
[6e41459] | 173 | installed in <xref linkend="chapter-building-system"/> is the one that
|
---|
[69993f4] | 174 | will ultimately end up being used, so that is the one that needs to pass
|
---|
[6e41459] | 175 | most tests (even in <xref linkend="chapter-building-system"/>, some
|
---|
| 176 | failures could still occur, for example, with the math tests).</para>
|
---|
| 177 |
|
---|
| 178 | <para>When experiencing a failure, make a note of it, then continue by
|
---|
| 179 | reissuing the <command>make check</command> command. The test suite should pick up where it left
|
---|
| 180 | off and continue. This stop-start sequence can be circumvented by
|
---|
| 181 | issuing a <command>make -k check</command> command. If using this option, be sure to log the
|
---|
| 182 | output so that the log file can be examined for failures later.</para>
|
---|
| 183 |
|
---|
[38bb44a] | 184 | <beginpage/>
|
---|
[6e41459] | 185 | <para>The install stage of Glibc will issue a harmless warning at the
|
---|
[e097438] | 186 | end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
| 187 | Prevent this warning with:</para>
|
---|
[1caa48e] | 188 |
|
---|
| 189 | <screen><userinput>mkdir /tools/etc
|
---|
| 190 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
| 191 |
|
---|
[6e41459] | 192 | <para>Install the package:</para>
|
---|
[73aedd1d] | 193 |
|
---|
| 194 | <screen><userinput>make install</userinput></screen>
|
---|
| 195 |
|
---|
[6e41459] | 196 | <para>Different countries and cultures have varying conventions for
|
---|
| 197 | how to communicate. These conventions range from the format for
|
---|
[69993f4] | 198 | representing dates and times to more complex issues, such as the
|
---|
| 199 | language spoken. The <quote>internationalization</quote> of GNU
|
---|
| 200 | programs works by locale.</para>
|
---|
[443cace] | 201 |
|
---|
[6e41459] | 202 | <note><para>If the test suites are not being run in this chapter (as
|
---|
| 203 | per the recommendation), there is no need to install the locales now.
|
---|
| 204 | The appropriate locales will be installed in the next
|
---|
| 205 | chapter.</para></note>
|
---|
[443cace] | 206 |
|
---|
[6e41459] | 207 | <para>To install the Glibc locales anyway, use the following
|
---|
| 208 | command:</para>
|
---|
[73aedd1d] | 209 |
|
---|
| 210 | <screen><userinput>make localedata/install-locales</userinput></screen>
|
---|
| 211 |
|
---|
[38bb44a] | 212 | <beginpage/>
|
---|
[69993f4] | 213 | <para>To save time, an alternative to running the
|
---|
[6e41459] | 214 | previous command (which generates and installs every locale Glibc is
|
---|
| 215 | aware of) is to install only those locales that are wanted and needed.
|
---|
| 216 | This can be achieved by using the <command>localedef</command>
|
---|
| 217 | command. Information on this command is located in the
|
---|
| 218 | <filename>INSTALL</filename> file in the Glibc source. However, there
|
---|
| 219 | are a number of locales that are essential in order for the tests of
|
---|
| 220 | future packages to pass, in particular, the
|
---|
| 221 | <emphasis>libstdc++</emphasis> tests from GCC. The following
|
---|
[e097438] | 222 | instructions, instead of the <parameter>install-locales</parameter>
|
---|
[6e41459] | 223 | target used above, will install the minimum set of locales necessary
|
---|
| 224 | for the tests to run successfully:</para>
|
---|
[73aedd1d] | 225 |
|
---|
| 226 | <screen><userinput>mkdir -p /tools/lib/locale
|
---|
| 227 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
| 228 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
| 229 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
| 230 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
| 231 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
| 232 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
[efb32ca] | 233 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
[73aedd1d] | 234 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
| 235 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
| 236 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
| 237 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
| 238 |
|
---|
| 239 | </sect2>
|
---|
[bc82645e] | 240 |
|
---|
[9652249] | 241 | <sect2 role="content"><title/>
|
---|
[c17fc85] | 242 | <para>Details on this package are located in <xref
|
---|
| 243 | linkend="contents-glibc" role="."/></para>
|
---|
[0868461] | 244 | </sect2>
|
---|
[5888299] | 245 |
|
---|
[bc82645e] | 246 | </sect1>
|
---|
[6e41459] | 247 |
|
---|