source: chapter05/glibc.xml@ f5ccac81

Last change on this file since f5ccac81 was f5ccac81, checked in by Jim Gifford <jim@…>, 20 years ago

Updates

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multi-arch/BOOK@4607 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 9.4 KB
Line 
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 %general-entities;
5]>
6<sect1 id="ch-tools-glibc" role="wrap">
7<title>Glibc-&glibc-version;</title>
8<?dbhtml filename="glibc.html"?>
9
10<indexterm zone="ch-tools-glibc">
11<primary sortas="a-Glibc">Glibc</primary>
12<secondary>tools</secondary></indexterm>
13
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])"/>
16
17<segmentedlist>
18<segtitle>&buildtime;</segtitle>
19<segtitle>&diskspace;</segtitle>
20<seglistitem><seg>11.8 SBU</seg><seg>800 MB</seg></seglistitem>
21</segmentedlist>
22
23<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
24
25</sect2>
26
27<sect2 role="installation">
28<title>Installation of Glibc</title>
29
30<para>This package is known to have issues when its default
31optimization flags (including the <parameter>-march</parameter> and
32<parameter>-mcpu</parameter> options) are changed. If any environment
33variables that override default optimizations have been defined, such
34as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
35unset them when building Glibc.</para>
36
37<para>It should be noted that compiling Glibc in any way other than
38the method suggested in this book puts the stability of the system at
39risk.</para>
40
41<para arch="ppc;raq2">Unpack the glibc-linuxthreads-&glibc-version; <emphasis>and</emphasis> the
42glibc-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
45will unfold into the same directory.</para>
46
47<para arch="ppc;raq2">NPTL is not supported under this architecture, so we are going to
48remove the nptl directory from the Glibc source:</para>
49
50<screen arch="ppc;raq2"><userinput>rm -rf nptl*</userinput></screen>
51
52<para>The Glibc documentation recommends building Glibc outside of the source
53directory in a dedicated build directory:</para>
54
55<screen><userinput>mkdir ../glibc-build
56cd ../glibc-build</userinput></screen>
57
58<para>Next, prepare Glibc for compilation:</para>
59
60<screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
61 --disable-profile --enable-add-ons \
62 --enable-kernel=2.6.0 --with-binutils=/tools/bin \
63 --without-gd --without-cvs --with-headers=/tools/include \
64 --disable-selinux</userinput></screen>
65
66<beginpage/>
67<para>The meaning of the configure options:</para>
68
69<variablelist>
70<varlistentry>
71<term><parameter>--disable-profile</parameter></term>
72<listitem><para>This builds the libraries without profiling
73information. Omit this option if profiling on the temporary tools is
74necessary.</para></listitem>
75</varlistentry>
76
77<varlistentry>
78<term><parameter>--enable-add-ons</parameter></term>
79<listitem><para>This tells Glibc to use the NPTL add-on as its threading
80library.</para></listitem>
81</varlistentry>
82
83<varlistentry>
84<term><parameter>--enable-kernel=2.6.0</parameter></term>
85<listitem><para>This tells Glibc to compile the library with support
86for 2.6.x Linux kernels.</para></listitem>
87</varlistentry>
88
89<varlistentry>
90<term><parameter>--with-binutils=/tools/bin</parameter></term>
91<listitem><para>While not required, this switch ensures that there are
92no errors pertaining to which Binutils programs get used during the
93Glibc build.</para></listitem>
94</varlistentry>
95
96<varlistentry>
97<term><parameter>--without-gd</parameter></term>
98<listitem><para>This prevents the build of the
99<command>memusagestat</command> program, which insists on linking
100against the host's libraries (libgd, libpng, libz,
101etc.).</para></listitem>
102</varlistentry>
103
104<varlistentry>
105<term><parameter>--without-cvs</parameter></term>
106<listitem><para>This prevents the Makefile files from
107attempting automatic CVS checkouts when using a CVS snapshot. While
108this command is not required, it is recommended because it suppresses
109an annoying, but harmless, warning about a missing autoconf
110program.</para></listitem>
111</varlistentry>
112
113<varlistentry>
114<term><parameter>--with-headers=/tools/include</parameter></term>
115<listitem><para>This tells Glibc to compile itself against the headers recently
116installed to the tools directory, so that it knows exactly what features the
117kernel has and can optimize itself accordingly.</para></listitem>
118</varlistentry>
119
120<!-- Edit Me -->
121<varlistentry>
122<term><parameter>--disable-selinux</parameter></term>
123<listitem><para>When building from hosts using SELinux functionality
124(i.e. Fedora Core 3), glibc will try to integrate this functionality into
125itself, but will fail, because we do not have this functionality in the LFS
126tools enviornment. This option will disable this, allowing glibc to build
127correctly, but will not otherwise affect the build.</para></listitem>
128</varlistentry>
129<!-- -->
130</variablelist>
131
132<beginpage/>
133<para>During this stage the following warning might appear:</para>
134
135<blockquote><screen><computeroutput>configure: WARNING:
136*** These auxiliary programs are missing or
137*** incompatible versions: msgfmt
138*** some features will be disabled.
139*** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
140
141<para>The missing or incompatible <command>msgfmt</command> program is
142generally harmless, but it can sometimes cause issues when running the
143test suite. This <command>msgfmt</command> program is part of the
144Gettext package which the host distribution should provide. If
145<command>msgfmt</command> is present but deemed incompatible, upgrade
146the host system's Gettext package or continue without it and see if
147the test suite runs without problems regardless.</para>
148
149<para>Compile the package:</para>
150
151<screen><userinput>make</userinput></screen>
152
153<para>Compilation is now complete. As mentioned earlier, running the
154test suites for the temporary tools installed in this chapter is not
155mandatory. To run the Glibc test suite (if desired), the following
156command will do so:</para>
157
158<screen><userinput>make check</userinput></screen>
159
160<para>For a discussion of test failures that are of particular
161importance, please see <xref linkend="ch-system-glibc" role="."/></para>
162
163<para>In this chapter, some tests can be adversely effected by
164existing tools or environmental issues on the host system. Glibc test
165suite failures in this chapter are typically not worrisome. The Glibc
166installed in <xref linkend="chapter-building-system"/> is the one that
167will ultimately end up being used, so that is the one that needs to pass
168most tests (even in <xref linkend="chapter-building-system"/>, some
169failures could still occur, for example, with the math tests).</para>
170
171<para>When experiencing a failure, make a note of it, then continue by
172reissuing the <command>make check</command> command. The test suite should pick up where it left
173off and continue. This stop-start sequence can be circumvented by
174issuing a <command>make -k check</command> command. If using this option, be sure to log the
175output so that the log file can be examined for failures later.</para>
176
177<beginpage/>
178<para>The install stage of Glibc will issue a harmless warning at the
179end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
180Prevent this warning with:</para>
181
182<screen><userinput>mkdir /tools/etc
183touch /tools/etc/ld.so.conf</userinput></screen>
184
185<para>Install the package:</para>
186
187<screen><userinput>make install</userinput></screen>
188
189<para>Different countries and cultures have varying conventions for
190how to communicate. These conventions range from the format for
191representing dates and times to more complex issues, such as the
192language spoken. The <quote>internationalization</quote> of GNU
193programs works by locale.</para>
194
195<note><para>If the test suites are not being run in this chapter (as
196per the recommendation), there is no need to install the locales now.
197The appropriate locales will be installed in the next
198chapter.</para></note>
199
200<para>To install the Glibc locales anyway, use the following
201command:</para>
202
203<screen><userinput>make localedata/install-locales</userinput></screen>
204
205<beginpage/>
206<para>To save time, an alternative to running the
207previous command (which generates and installs every locale Glibc is
208aware of) is to install only those locales that are wanted and needed.
209This can be achieved by using the <command>localedef</command>
210command. Information on this command is located in the
211<filename>INSTALL</filename> file in the Glibc source. However, there
212are a number of locales that are essential in order for the tests of
213future packages to pass, in particular, the
214<emphasis>libstdc++</emphasis> tests from GCC. The following
215instructions, instead of the <parameter>install-locales</parameter>
216target used above, will install the minimum set of locales necessary
217for the tests to run successfully:</para>
218
219<screen><userinput>mkdir -p /tools/lib/locale
220localedef -i de_DE -f ISO-8859-1 de_DE
221localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
222localedef -i en_HK -f ISO-8859-1 en_HK
223localedef -i en_PH -f ISO-8859-1 en_PH
224localedef -i en_US -f ISO-8859-1 en_US
225localedef -i es_MX -f ISO-8859-1 es_MX
226localedef -i fa_IR -f UTF-8 fa_IR
227localedef -i fr_FR -f ISO-8859-1 fr_FR
228localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
229localedef -i it_IT -f ISO-8859-1 it_IT
230localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
231
232</sect2>
233
234<sect2 role="content"><title/>
235<para>Details on this package are located in <xref
236linkend="contents-glibc" role="."/></para>
237</sect2>
238
239</sect1>
240
Note: See TracBrowser for help on using the repository browser.