[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 |
|
---|
| 41 | <para>The Glibc documentation recommends building Glibc outside of the source
|
---|
| 42 | directory in a dedicated build directory:</para>
|
---|
| 43 |
|
---|
| 44 | <screen><userinput>mkdir ../glibc-build
|
---|
| 45 | cd ../glibc-build</userinput></screen>
|
---|
| 46 |
|
---|
[d27a27b] | 47 | <para>Next, prepare Glibc for compilation:</para>
|
---|
[73aedd1d] | 48 |
|
---|
[9dfc02f] | 49 | <screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
[c9214d5] | 50 | --disable-profile --enable-add-ons \
|
---|
| 51 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
| 52 | --without-gd --without-cvs --with-headers=/tools/include</userinput></screen>
|
---|
[73aedd1d] | 53 |
|
---|
[38bb44a] | 54 | <beginpage/>
|
---|
[73aedd1d] | 55 | <para>The meaning of the configure options:</para>
|
---|
| 56 |
|
---|
[9652249] | 57 | <variablelist>
|
---|
| 58 | <varlistentry>
|
---|
[574b0ea] | 59 | <term><parameter>--disable-profile</parameter></term>
|
---|
[6e41459] | 60 | <listitem><para>This builds the libraries without profiling
|
---|
| 61 | information. Omit this option if profiling on the temporary tools is
|
---|
| 62 | necessary.</para></listitem>
|
---|
[9652249] | 63 | </varlistentry>
|
---|
| 64 |
|
---|
| 65 | <varlistentry>
|
---|
[c9214d5] | 66 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
[9652249] | 67 | <listitem><para>This tells Glibc to use the NPTL add-on as its threading
|
---|
| 68 | library.</para></listitem>
|
---|
| 69 | </varlistentry>
|
---|
| 70 |
|
---|
[4fdb55e] | 71 | <varlistentry>
|
---|
| 72 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
[6e41459] | 73 | <listitem><para>This tells Glibc to compile the library with support
|
---|
| 74 | for 2.6.x Linux kernels.</para></listitem>
|
---|
[4fdb55e] | 75 | </varlistentry>
|
---|
| 76 |
|
---|
[9652249] | 77 | <varlistentry>
|
---|
[574b0ea] | 78 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
[6e41459] | 79 | <listitem><para>While not required, this switch ensures that there are
|
---|
| 80 | no errors pertaining to which Binutils programs get used during the
|
---|
[9652249] | 81 | Glibc build.</para></listitem>
|
---|
| 82 | </varlistentry>
|
---|
| 83 |
|
---|
| 84 | <varlistentry>
|
---|
[574b0ea] | 85 | <term><parameter>--without-gd</parameter></term>
|
---|
[6e41459] | 86 | <listitem><para>This prevents the build of the
|
---|
| 87 | <command>memusagestat</command> program, which insists on linking
|
---|
| 88 | against the host's libraries (libgd, libpng, libz,
|
---|
| 89 | etc.).</para></listitem>
|
---|
[9652249] | 90 | </varlistentry>
|
---|
| 91 |
|
---|
| 92 | <varlistentry>
|
---|
[574b0ea] | 93 | <term><parameter>--without-cvs</parameter></term>
|
---|
[69993f4] | 94 | <listitem><para>This prevents the Makefile files from
|
---|
[6e41459] | 95 | attempting automatic CVS checkouts when using a CVS snapshot. While
|
---|
| 96 | this command is not required, it is recommended because it suppresses
|
---|
| 97 | an annoying, but harmless, warning about a missing autoconf
|
---|
| 98 | program.</para></listitem>
|
---|
[9652249] | 99 | </varlistentry>
|
---|
[9dfc02f] | 100 |
|
---|
[9652249] | 101 | <varlistentry>
|
---|
[c9214d5] | 102 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
| 103 | <listitem><para>This tells Glibc to compile itself against the headers recently
|
---|
| 104 | installed to the tools directory, so that it knows exactly what features the
|
---|
| 105 | kernel has and can optimize itself accordingly.</para></listitem>
|
---|
[9652249] | 106 | </varlistentry>
|
---|
| 107 | </variablelist>
|
---|
[73aedd1d] | 108 |
|
---|
[38bb44a] | 109 | <beginpage/>
|
---|
[69993f4] | 110 | <para>During this stage the following warning might appear:</para>
|
---|
[73aedd1d] | 111 |
|
---|
[574b0ea] | 112 | <blockquote><screen><computeroutput>configure: WARNING:
|
---|
[c863747] | 113 | *** These auxiliary programs are missing or
|
---|
| 114 | *** incompatible versions: msgfmt
|
---|
[73aedd1d] | 115 | *** some features will be disabled.
|
---|
[574b0ea] | 116 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
[73aedd1d] | 117 |
|
---|
[ede9b9b] | 118 | <para>The missing or incompatible <command>msgfmt</command> program is
|
---|
[69993f4] | 119 | generally harmless, but it can sometimes cause issues when running the
|
---|
| 120 | test suite. This <command>msgfmt</command> program is part of the
|
---|
| 121 | Gettext package which the host distribution should provide. If
|
---|
| 122 | <command>msgfmt</command> is present but deemed incompatible, upgrade
|
---|
| 123 | the host system's Gettext package or continue without it and see if
|
---|
| 124 | the test suite runs without problems regardless.</para>
|
---|
[73aedd1d] | 125 |
|
---|
| 126 | <para>Compile the package:</para>
|
---|
| 127 |
|
---|
| 128 | <screen><userinput>make</userinput></screen>
|
---|
| 129 |
|
---|
[6e41459] | 130 | <para>Compilation is now complete. As mentioned earlier, running the
|
---|
| 131 | test suites for the temporary tools installed in this chapter is not
|
---|
| 132 | mandatory. To run the Glibc test suite (if desired), the following
|
---|
| 133 | command will do so:</para>
|
---|
[73aedd1d] | 134 |
|
---|
| 135 | <screen><userinput>make check</userinput></screen>
|
---|
| 136 |
|
---|
[d878ce3] | 137 | <para>For a discussion of test failures that are of particular
|
---|
[e097438] | 138 | importance, please see <xref linkend="ch-system-glibc" role="."/></para>
|
---|
[d878ce3] | 139 |
|
---|
[69993f4] | 140 | <para>In this chapter, some tests can be adversely effected by
|
---|
[6e41459] | 141 | existing tools or environmental issues on the host system. Glibc test
|
---|
[69993f4] | 142 | suite failures in this chapter are typically not worrisome. The Glibc
|
---|
[6e41459] | 143 | installed in <xref linkend="chapter-building-system"/> is the one that
|
---|
[69993f4] | 144 | will ultimately end up being used, so that is the one that needs to pass
|
---|
[6e41459] | 145 | most tests (even in <xref linkend="chapter-building-system"/>, some
|
---|
| 146 | failures could still occur, for example, with the math tests).</para>
|
---|
| 147 |
|
---|
| 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 should pick up where it left
|
---|
| 150 | off and continue. This stop-start sequence can be circumvented by
|
---|
| 151 | issuing a <command>make -k check</command> command. If using this option, be sure to log the
|
---|
| 152 | output so that the log file can be examined for failures later.</para>
|
---|
| 153 |
|
---|
[38bb44a] | 154 | <beginpage/>
|
---|
[6e41459] | 155 | <para>The install stage of Glibc will issue a harmless warning at the
|
---|
[e097438] | 156 | end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
| 157 | Prevent this warning with:</para>
|
---|
[1caa48e] | 158 |
|
---|
| 159 | <screen><userinput>mkdir /tools/etc
|
---|
| 160 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
| 161 |
|
---|
[6e41459] | 162 | <para>Install the package:</para>
|
---|
[73aedd1d] | 163 |
|
---|
| 164 | <screen><userinput>make install</userinput></screen>
|
---|
| 165 |
|
---|
[6e41459] | 166 | <para>Different countries and cultures have varying conventions for
|
---|
| 167 | how to communicate. These conventions range from the format for
|
---|
[69993f4] | 168 | representing dates and times to more complex issues, such as the
|
---|
| 169 | language spoken. The <quote>internationalization</quote> of GNU
|
---|
| 170 | programs works by locale.</para>
|
---|
[443cace] | 171 |
|
---|
[6e41459] | 172 | <note><para>If the test suites are not being run in this chapter (as
|
---|
| 173 | per the recommendation), there is no need to install the locales now.
|
---|
| 174 | The appropriate locales will be installed in the next
|
---|
| 175 | chapter.</para></note>
|
---|
[443cace] | 176 |
|
---|
[6e41459] | 177 | <para>To install the Glibc locales anyway, use the following
|
---|
| 178 | command:</para>
|
---|
[73aedd1d] | 179 |
|
---|
| 180 | <screen><userinput>make localedata/install-locales</userinput></screen>
|
---|
| 181 |
|
---|
[38bb44a] | 182 | <beginpage/>
|
---|
[69993f4] | 183 | <para>To save time, an alternative to running the
|
---|
[6e41459] | 184 | previous command (which generates and installs every locale Glibc is
|
---|
| 185 | aware of) is to install only those locales that are wanted and needed.
|
---|
| 186 | This can be achieved by using the <command>localedef</command>
|
---|
| 187 | command. Information on this command is located in the
|
---|
| 188 | <filename>INSTALL</filename> file in the Glibc source. However, there
|
---|
| 189 | are a number of locales that are essential in order for the tests of
|
---|
| 190 | future packages to pass, in particular, the
|
---|
| 191 | <emphasis>libstdc++</emphasis> tests from GCC. The following
|
---|
[e097438] | 192 | instructions, instead of the <parameter>install-locales</parameter>
|
---|
[6e41459] | 193 | target used above, will install the minimum set of locales necessary
|
---|
| 194 | for the tests to run successfully:</para>
|
---|
[73aedd1d] | 195 |
|
---|
| 196 | <screen><userinput>mkdir -p /tools/lib/locale
|
---|
| 197 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
| 198 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
| 199 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
| 200 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
| 201 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
| 202 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
[efb32ca] | 203 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
[73aedd1d] | 204 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
| 205 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
| 206 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
| 207 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
| 208 |
|
---|
| 209 | </sect2>
|
---|
[bc82645e] | 210 |
|
---|
[9652249] | 211 | <sect2 role="content"><title/>
|
---|
[c17fc85] | 212 | <para>Details on this package are located in <xref
|
---|
| 213 | linkend="contents-glibc" role="."/></para>
|
---|
[0868461] | 214 | </sect2>
|
---|
[5888299] | 215 |
|
---|
[bc82645e] | 216 | </sect1>
|
---|
[6e41459] | 217 |
|
---|