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