[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[1375d26] | 2 | <!DOCTYPE section [
|
---|
[673b0d8] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[1375d26] | 6 | <section xmlns="http://docbook.org/docbook-ng"
|
---|
| 7 | xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 8 | xml:id="ch-tools-glibc" role="wrap">
|
---|
[673b0d8] | 9 | <title>Glibc-&glibc-version;</title>
|
---|
| 10 | <?dbhtml filename="glibc.html"?>
|
---|
[bc82645e] | 11 |
|
---|
[673b0d8] | 12 | <indexterm zone="ch-tools-glibc">
|
---|
| 13 | <primary sortas="a-Glibc">Glibc</primary>
|
---|
| 14 | <secondary>tools</secondary></indexterm>
|
---|
[bc82645e] | 15 |
|
---|
[1375d26] | 16 | <section role="package"><title/>
|
---|
| 17 | <xi:include href="../chapter06/glibc.xml" xpointer="xpointer(/*[1]/*[3]/*[2])"/>
|
---|
[673b0d8] | 18 |
|
---|
[9652249] | 19 | <segmentedlist>
|
---|
| 20 | <segtitle>&buildtime;</segtitle>
|
---|
| 21 | <segtitle>&diskspace;</segtitle>
|
---|
| 22 | <seglistitem><seg>11.8 SBU</seg><seg>800 MB</seg></seglistitem>
|
---|
| 23 | </segmentedlist>
|
---|
[673b0d8] | 24 |
|
---|
[1375d26] | 25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/*[1]/*[3]/*[4])"/>
|
---|
[73aedd1d] | 26 |
|
---|
[1375d26] | 27 | </section>
|
---|
[73aedd1d] | 28 |
|
---|
[1375d26] | 29 | <section role="installation">
|
---|
[5888299] | 30 | <title>Installation of Glibc</title>
|
---|
[73aedd1d] | 31 |
|
---|
[ede9b9b] | 32 | <para>This package is known to behave badly when you change its default
|
---|
[574b0ea] | 33 | optimization flags (including the <parameter>-march</parameter> and
|
---|
| 34 | <parameter>-mcpu</parameter> options). Therefore, if you have defined any
|
---|
[ede9b9b] | 35 | environment variables that override default optimizations, such as CFLAGS and
|
---|
[673b0d8] | 36 | CXXFLAGS, we recommend un-setting them when building Glibc.</para>
|
---|
[73aedd1d] | 37 |
|
---|
| 38 | <para>Basically, compiling Glibc in any other way than the book suggests
|
---|
| 39 | is putting the stability of your system at risk.</para>
|
---|
| 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 \
|
---|
[084db8d] | 50 | --disable-profile --enable-add-ons \
|
---|
| 51 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
[cb2892d] | 52 | --without-gd --without-cvs --with-headers=/tools/include</userinput></screen>
|
---|
[73aedd1d] | 53 |
|
---|
| 54 | <para>The meaning of the configure options:</para>
|
---|
| 55 |
|
---|
[9652249] | 56 | <variablelist>
|
---|
| 57 | <varlistentry>
|
---|
[574b0ea] | 58 | <term><parameter>--disable-profile</parameter></term>
|
---|
[9652249] | 59 | <listitem><para>This builds the
|
---|
[9dfc02f] | 60 | libraries without profiling information. Omit this option if you plan to do
|
---|
[9652249] | 61 | profiling on the temporary tools.</para></listitem>
|
---|
| 62 | </varlistentry>
|
---|
| 63 |
|
---|
| 64 | <varlistentry>
|
---|
[f4f0cb4] | 65 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
| 66 | <listitem><para>This tells Glibc to use the add-on' that it can use like NPTL
|
---|
| 67 | as its threading library.</para></listitem>
|
---|
[7e2b777] | 68 | </varlistentry>
|
---|
| 69 |
|
---|
| 70 | <varlistentry>
|
---|
| 71 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
| 72 | <listitem><para>This tells Glibc to compile the library for support of
|
---|
| 73 | linux 2.6.x kernels.
|
---|
| 74 | </para></listitem>
|
---|
| 75 | </varlistentry>
|
---|
| 76 |
|
---|
[9652249] | 77 | <varlistentry>
|
---|
[574b0ea] | 78 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
[9652249] | 79 | <listitem><para>Strictly speaking this switch is not required. But it does ensure
|
---|
| 80 | nothing can go wrong with regard to what Binutils programs get used during the
|
---|
| 81 | Glibc build.</para></listitem>
|
---|
| 82 | </varlistentry>
|
---|
| 83 |
|
---|
| 84 | <varlistentry>
|
---|
[574b0ea] | 85 | <term><parameter>--without-gd</parameter></term>
|
---|
[9652249] | 86 | <listitem><para>This prevents the build of the <command>memusagestat</command>
|
---|
| 87 | program, which strangely enough insists on linking against the host's libraries
|
---|
| 88 | (libgd, libpng, libz, and so forth). </para></listitem>
|
---|
| 89 | </varlistentry>
|
---|
| 90 |
|
---|
| 91 | <varlistentry>
|
---|
[574b0ea] | 92 | <term><parameter>--without-cvs</parameter></term>
|
---|
[9652249] | 93 | <listitem><para>This is meant to prevent
|
---|
[c76accc] | 94 | the Makefiles from attempting automatic CVS checkouts when using a CVS
|
---|
| 95 | snapshot. But it's not actually needed these days. We use it because it
|
---|
| 96 | suppresses an annoying but harmless warning about a missing
|
---|
| 97 | <command>autoconf</command> program.</para></listitem>
|
---|
[9652249] | 98 | </varlistentry>
|
---|
[cb2892d] | 99 |
|
---|
| 100 | <varlistentry>
|
---|
| 101 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
| 102 | <listitem><para>This forces glibc to use the linux-libc-headers installed
|
---|
[dbde549] | 103 | in /tools/include, rather than those on the host, which may be too old to
|
---|
[cb2892d] | 104 | support needed functionality.</para></listitem>
|
---|
| 105 | </varlistentry>
|
---|
| 106 |
|
---|
[9652249] | 107 | </variablelist>
|
---|
[73aedd1d] | 108 |
|
---|
| 109 | <para>During this stage you might see the following warning:</para>
|
---|
| 110 |
|
---|
[574b0ea] | 111 | <blockquote><screen><computeroutput>configure: WARNING:
|
---|
[73aedd1d] | 112 | *** These auxiliary programs are missing or incompatible versions: msgfmt
|
---|
| 113 | *** some features will be disabled.
|
---|
[574b0ea] | 114 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
[73aedd1d] | 115 |
|
---|
[ede9b9b] | 116 | <para>The missing or incompatible <command>msgfmt</command> program is
|
---|
[73aedd1d] | 117 | generally harmless, but it's believed it can sometimes cause problems when
|
---|
| 118 | running the test suite.</para>
|
---|
| 119 |
|
---|
| 120 | <para>Compile the package:</para>
|
---|
| 121 |
|
---|
| 122 | <screen><userinput>make</userinput></screen>
|
---|
| 123 |
|
---|
[d878ce3] | 124 | <para>Compilation is now complete. As mentioned earlier, running the test suites
|
---|
| 125 | for the temporary tools installed in this chapter is not mandatory. If you want
|
---|
| 126 | to run the Glibc test suite though, the following command will do so:</para>
|
---|
[73aedd1d] | 127 |
|
---|
| 128 | <screen><userinput>make check</userinput></screen>
|
---|
| 129 |
|
---|
[d878ce3] | 130 | <para>For a discussion of test failures that are of particular
|
---|
| 131 | importance, please see <xref linkend="ch-system-glibc"/>.</para>
|
---|
| 132 |
|
---|
| 133 | <para>In this chapter, some tests can be adversely affected by existing tools or
|
---|
| 134 | environmental issues on the host system. In short, don't worry too much if you
|
---|
| 135 | see Glibc test suite failures in this chapter. The Glibc in
|
---|
| 136 | <xref linkend="chapter-building-system"/> is the one we'll ultimately end up
|
---|
| 137 | using, so that is the one we would really like to see pass the tests (but even
|
---|
| 138 | there some failures could still occur -- the <emphasis>math</emphasis> tests,
|
---|
| 139 | for example).</para>
|
---|
| 140 |
|
---|
| 141 | <para>When experiencing a failure, make a note of it, then continue by reissuing
|
---|
| 142 | the <command>make check</command>. The test suite should pick up where it left
|
---|
| 143 | off and continue. You can circumvent this stop-start sequence by issuing a
|
---|
| 144 | <command>make -k check</command>. If you do that though, be sure to log the
|
---|
| 145 | output so that you can later peruse the log file and examine the total number of
|
---|
| 146 | failures.</para>
|
---|
[ede9b9b] | 147 |
|
---|
| 148 | <para>Though it is a harmless message, the install stage of Glibc will at the
|
---|
| 149 | end complain about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
| 150 | Prevent this confusing little warning with:</para>
|
---|
[1caa48e] | 151 |
|
---|
| 152 | <screen><userinput>mkdir /tools/etc
|
---|
| 153 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
| 154 |
|
---|
[73aedd1d] | 155 | <para>Now install the package:</para>
|
---|
| 156 |
|
---|
| 157 | <screen><userinput>make install</userinput></screen>
|
---|
| 158 |
|
---|
| 159 | <para>Different countries and cultures have varying conventions for how to
|
---|
| 160 | communicate. These conventions range from very simple ones, such as the format
|
---|
| 161 | for representing dates and times, to very complex ones, such as the language
|
---|
[673b0d8] | 162 | spoken. The <quote>internationalization</quote> of GNU programs works by means
|
---|
| 163 | of <emphasis>locales</emphasis>.</para>
|
---|
[443cace] | 164 |
|
---|
| 165 | <note><para>If you are not running the test suites here in this chapter as per
|
---|
| 166 | our recommendation, there is little point in installing the locales now. We'll
|
---|
| 167 | be installing the locales in the next chapter.</para></note>
|
---|
| 168 |
|
---|
| 169 | <para>If you still want to install the Glibc locales anyway, the following
|
---|
| 170 | command will do so:</para>
|
---|
[73aedd1d] | 171 |
|
---|
| 172 | <screen><userinput>make localedata/install-locales</userinput></screen>
|
---|
| 173 |
|
---|
[d0a6c4c] | 174 | <para>An alternative to running the previous command is to install only those
|
---|
| 175 | locales which you need or want. This can be achieved by using the
|
---|
[90e3cb3] | 176 | <command>localedef</command> command. Information on this can be found in
|
---|
[d0a6c4c] | 177 | the <filename>INSTALL</filename> file in the Glibc source. However, there are
|
---|
| 178 | a number of locales that are essential for the tests of future packages to
|
---|
| 179 | pass, in particular, the <emphasis>libstdc++</emphasis> tests from GCC. The
|
---|
| 180 | following instructions, instead of the install-locales target above, will
|
---|
| 181 | install the minimum set of locales necessary for the tests to run
|
---|
| 182 | successfully:</para>
|
---|
[73aedd1d] | 183 |
|
---|
| 184 | <screen><userinput>mkdir -p /tools/lib/locale
|
---|
| 185 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
| 186 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
| 187 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
| 188 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
| 189 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
| 190 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
[efb32ca] | 191 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
[73aedd1d] | 192 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
| 193 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
| 194 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
| 195 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
| 196 |
|
---|
[1375d26] | 197 | </section>
|
---|
[bc82645e] | 198 |
|
---|
[1375d26] | 199 | <section role="content"><title/>
|
---|
[5888299] | 200 | <para>The details on this package are found in <xref linkend="contents-glibc"/>.</para>
|
---|
[1375d26] | 201 | </section>
|
---|
[5888299] | 202 |
|
---|
[1375d26] | 203 | </section>
|
---|