1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | <!ENTITY % patches-entities SYSTEM "../patches.ent">
|
---|
5 | %general-entities;
|
---|
6 | %patches-entities;
|
---|
7 | ]>
|
---|
8 | <sect1 id="ch-tools-glibc" role="wrap">
|
---|
9 | <title>Glibc-&glibc-version;</title>
|
---|
10 | <?dbhtml filename="glibc.html"?>
|
---|
11 |
|
---|
12 | <indexterm zone="ch-tools-glibc">
|
---|
13 | <primary sortas="a-Glibc">Glibc</primary>
|
---|
14 | <secondary>tools</secondary></indexterm>
|
---|
15 |
|
---|
16 | <sect2 role="package"><title/>
|
---|
17 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
---|
18 |
|
---|
19 | <segmentedlist>
|
---|
20 | <segtitle>&buildtime;</segtitle>
|
---|
21 | <segtitle>&diskspace;</segtitle>
|
---|
22 | <seglistitem><seg>11.8 SBU</seg><seg>454 MB</seg></seglistitem>
|
---|
23 | </segmentedlist>
|
---|
24 |
|
---|
25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
|
---|
26 |
|
---|
27 | </sect2>
|
---|
28 |
|
---|
29 | <sect2 role="installation">
|
---|
30 | <title>Installation of Glibc</title>
|
---|
31 |
|
---|
32 | <para>This package is known to have issues when its default
|
---|
33 | optimization flags (including the <parameter>-march</parameter> and
|
---|
34 | <parameter>-mcpu</parameter> options) are changed. If any environment
|
---|
35 | variables that override default optimizations have been defined, such
|
---|
36 | as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
|
---|
37 | unset them when building Glibc.</para>
|
---|
38 |
|
---|
39 | <para>It should be noted that compiling Glibc in any way other than
|
---|
40 | the method suggested in this book puts the stability of the system at
|
---|
41 | risk.</para>
|
---|
42 |
|
---|
43 | <para>Glibc has two tests which fail when the running kernel is 2.6.11 or later.
|
---|
44 | The problem has been determined to be with the tests themselves, not with the C library or the kernel. If you plan to run the testsuite apply this patch:</para>
|
---|
45 |
|
---|
46 | <screen><userinput>patch -Np1 -i ../&glibc-testfix-patch;</userinput></screen>
|
---|
47 |
|
---|
48 | <para>Apply the following patches to enable Glibc to compile with
|
---|
49 | GCC-&gcc-version;:</para>
|
---|
50 |
|
---|
51 |
|
---|
52 | <screen><userinput>patch -Np1 -i ../&glibc-gcc4_symbols-patch;
|
---|
53 | patch -Np1 -i ../&glibc-gcc4_string-patch;
|
---|
54 | patch -Np1 -i ../&glibc-gcc4_elf-patch;
|
---|
55 | patch -Np1 -i ../&glibc-gcc4_iconvdata-patch;</userinput></screen>
|
---|
56 |
|
---|
57 | <para>The Glibc documentation recommends building Glibc outside of the source
|
---|
58 | directory in a dedicated build directory:</para>
|
---|
59 |
|
---|
60 | <screen><userinput>mkdir -v ../glibc-build
|
---|
61 | cd ../glibc-build</userinput></screen>
|
---|
62 |
|
---|
63 | <para>Next, prepare Glibc for compilation:</para>
|
---|
64 |
|
---|
65 | <screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
|
---|
66 | --disable-profile --enable-add-ons \
|
---|
67 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
68 | --without-gd --with-headers=/tools/include \
|
---|
69 | --without-selinux</userinput></screen>
|
---|
70 |
|
---|
71 | <para>The meaning of the configure options:</para>
|
---|
72 |
|
---|
73 | <variablelist>
|
---|
74 | <varlistentry>
|
---|
75 | <term><parameter>--disable-profile</parameter></term>
|
---|
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>
|
---|
79 | </varlistentry>
|
---|
80 |
|
---|
81 | <varlistentry>
|
---|
82 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
83 | <listitem><para>This tells Glibc to use the NPTL add-on as its threading
|
---|
84 | library.</para></listitem>
|
---|
85 | </varlistentry>
|
---|
86 |
|
---|
87 | <varlistentry>
|
---|
88 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
89 | <listitem><para>This tells Glibc to compile the library with support
|
---|
90 | for 2.6.x Linux kernels.</para></listitem>
|
---|
91 | </varlistentry>
|
---|
92 |
|
---|
93 | <varlistentry>
|
---|
94 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
95 | <listitem><para>While not required, this switch ensures that there are
|
---|
96 | no errors pertaining to which Binutils programs get used during the
|
---|
97 | Glibc build.</para></listitem>
|
---|
98 | </varlistentry>
|
---|
99 |
|
---|
100 | <varlistentry>
|
---|
101 | <term><parameter>--without-gd</parameter></term>
|
---|
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>
|
---|
106 | </varlistentry>
|
---|
107 |
|
---|
108 | <varlistentry>
|
---|
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>
|
---|
113 | </varlistentry>
|
---|
114 |
|
---|
115 | <varlistentry>
|
---|
116 | <term><parameter>--without-selinux</parameter></term>
|
---|
117 | <listitem><para>When building from hosts that include SELinux functionality
|
---|
118 | (e.g. Fedora Core 3), Glibc will build with support for SELinux. As the LFS
|
---|
119 | tools environment does not contain support for SELinux, a Glibc compiled with
|
---|
120 | such support will fail to operate correctly.</para></listitem>
|
---|
121 | </varlistentry>
|
---|
122 | </variablelist>
|
---|
123 |
|
---|
124 | <para>During this stage the following warning might appear:</para>
|
---|
125 |
|
---|
126 | <blockquote><screen><computeroutput>configure: WARNING:
|
---|
127 | *** These auxiliary programs are missing or
|
---|
128 | *** incompatible versions: msgfmt
|
---|
129 | *** some features will be disabled.
|
---|
130 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
131 |
|
---|
132 | <para>The missing or incompatible <command>msgfmt</command> program is
|
---|
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>
|
---|
139 |
|
---|
140 | <para>Compile the package:</para>
|
---|
141 |
|
---|
142 | <screen><userinput>make</userinput></screen>
|
---|
143 |
|
---|
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>
|
---|
148 |
|
---|
149 | <screen><userinput>make check</userinput></screen>
|
---|
150 |
|
---|
151 | <para>For a discussion of test failures that are of particular
|
---|
152 | importance, please see <xref linkend="ch-system-glibc" role="."/></para>
|
---|
153 |
|
---|
154 | <para>In this chapter, some tests can be adversely affected by
|
---|
155 | existing tools or environmental issues on the host system. Glibc test
|
---|
156 | suite failures in this chapter are typically not worrisome. The Glibc
|
---|
157 | installed in <xref linkend="chapter-building-system"/> is the one that
|
---|
158 | will ultimately end up being used, so that is the one that needs to pass
|
---|
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 |
|
---|
168 | <para>The install stage of Glibc will issue a harmless warning at the
|
---|
169 | end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
170 | Prevent this warning with:</para>
|
---|
171 |
|
---|
172 | <screen><userinput>mkdir -v /tools/etc
|
---|
173 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
174 |
|
---|
175 | <para>Install the package:</para>
|
---|
176 |
|
---|
177 | <screen><userinput>make install</userinput></screen>
|
---|
178 |
|
---|
179 | <para>Different countries and cultures have varying conventions for
|
---|
180 | how to communicate. These conventions range from the format for
|
---|
181 | representing dates and times to more complex issues, such as the
|
---|
182 | language spoken. The <quote>internationalization</quote> of GNU
|
---|
183 | programs works by locale.</para>
|
---|
184 |
|
---|
185 | <note><para>If the test suites are not being run in this chapter (as
|
---|
186 | per the recommendation), there is no need to install the locales now.
|
---|
187 | The appropriate locales will be installed in the next
|
---|
188 | chapter.</para></note>
|
---|
189 |
|
---|
190 | <para>To install the Glibc locales anyway, use the following
|
---|
191 | command:</para>
|
---|
192 |
|
---|
193 | <screen role="nodump"><userinput>make localedata/install-locales</userinput></screen>
|
---|
194 |
|
---|
195 | <para>To save time, an alternative to running the
|
---|
196 | previous command (which generates and installs every locale Glibc is
|
---|
197 | aware of) is to install only those locales that are wanted and needed.
|
---|
198 | This can be achieved by using the <command>localedef</command>
|
---|
199 | command. Information on this command is located in the
|
---|
200 | <filename>INSTALL</filename> file in the Glibc source. However, there
|
---|
201 | are a number of locales that are essential in order for the tests of
|
---|
202 | future packages to pass, in particular, the
|
---|
203 | <emphasis>libstdc++</emphasis> tests from GCC. The following
|
---|
204 | instructions, instead of the <parameter>install-locales</parameter>
|
---|
205 | target used above, will install the minimum set of locales necessary
|
---|
206 | for the tests to run successfully:</para>
|
---|
207 |
|
---|
208 | <screen><userinput>mkdir -pv /tools/lib/locale
|
---|
209 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
210 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
211 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
212 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
213 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
214 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
215 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
216 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
217 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
218 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
219 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
220 |
|
---|
221 | </sect2>
|
---|
222 |
|
---|
223 | <sect2 role="content"><title/>
|
---|
224 | <para>Details on this package are located in <xref
|
---|
225 | linkend="contents-glibc" role="."/></para>
|
---|
226 | </sect2>
|
---|
227 |
|
---|
228 | </sect1>
|
---|
229 |
|
---|