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