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