source: chapter05/glibc.xml@ c863747

6.0
Last change on this file since c863747 was c863747, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Wrapped the commands until Chapter 5 to 60 chars.
Testing new look for 'cat > .... << EOF' blocks.

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

  • Property mode set to 100644
File size: 8.8 KB
Line 
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]>
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 <emphasis>CFLAGS</emphasis> and <emphasis>CXXFLAGS</emphasis>,
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>The Glibc documentation recommends building Glibc outside of the source
42directory in a dedicated build directory:</para>
43
44<screen><userinput>mkdir ../glibc-build
45cd ../glibc-build</userinput></screen>
46
47<para>Next, prepare Glibc for compilation:</para>
48
49<screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
50 --disable-profile --enable-add-ons=nptl --with-tls \
51 --with-__thread --enable-kernel=2.6.0 \
52 --with-binutils=/tools/bin --without-gd --without-cvs \
53 --with-headers=/tools/glibc-kernheaders</userinput></screen>
54
55<para>The meaning of the configure options:</para>
56
57<variablelist>
58<varlistentry>
59<term><parameter>--disable-profile</parameter></term>
60<listitem><para>This builds the libraries without profiling
61information. Omit this option if profiling on the temporary tools is
62necessary.</para></listitem>
63</varlistentry>
64
65<varlistentry>
66<term><parameter>--enable-add-ons=nptl</parameter></term>
67<listitem><para>This tells Glibc to use the NPTL add-on as its threading
68library.</para></listitem>
69</varlistentry>
70
71<varlistentry>
72<term><parameter>--with-tls</parameter></term>
73<listitem><para>This tells Glibc to include support for Thread-Local
74Storage (TLS). This is required in order for NPTL to work.
75</para></listitem>
76</varlistentry>
77
78<varlistentry>
79<term><parameter>--with-__thread</parameter></term>
80<listitem><para>This option tells Glibc to include thread support. It is
81required in order for TLS to be properly compiled.</para></listitem>
82</varlistentry>
83
84<varlistentry>
85<term><parameter>--enable-kernel=2.6.0</parameter></term>
86<listitem><para>This tells Glibc to compile the library with support
87for 2.6.x Linux kernels.</para></listitem>
88</varlistentry>
89
90<varlistentry>
91<term><parameter>--with-binutils=/tools/bin</parameter></term>
92<listitem><para>While not required, this switch ensures that there are
93no errors pertaining to which Binutils programs get used during the
94Glibc build.</para></listitem>
95</varlistentry>
96
97<varlistentry>
98<term><parameter>--without-gd</parameter></term>
99<listitem><para>This prevents the build of the
100<command>memusagestat</command> program, which insists on linking
101against the host's libraries (libgd, libpng, libz,
102etc.).</para></listitem>
103</varlistentry>
104
105<varlistentry>
106<term><parameter>--without-cvs</parameter></term>
107<listitem><para>This prevents the Makefile files from
108attempting automatic CVS checkouts when using a CVS snapshot. While
109this command is not required, it is recommended because it suppresses
110an annoying, but harmless, warning about a missing autoconf
111program.</para></listitem>
112</varlistentry>
113
114<varlistentry>
115<term><parameter>--with-headers=/tools/glibc-kernheaders</parameter></term>
116<listitem><para>This tells Glibc to compile itself against the <quote>raw</quote>
117kernel headers, so that it knows exactly what features the kernel has and can
118optimize itself accordingly.</para></listitem>
119</varlistentry>
120</variablelist>
121
122<para>During this stage the following warning might appear:</para>
123
124<blockquote><screen><computeroutput>configure: WARNING:
125*** These auxiliary programs are missing or
126*** incompatible versions: msgfmt
127*** some features will be disabled.
128*** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
129
130<para>The missing or incompatible <command>msgfmt</command> program is
131generally harmless, but it can sometimes cause issues when running the
132test suite. This <command>msgfmt</command> program is part of the
133Gettext package which the host distribution should provide. If
134<command>msgfmt</command> is present but deemed incompatible, upgrade
135the host system's Gettext package or continue without it and see if
136the test suite runs without problems regardless.</para>
137
138<para>Compile the package:</para>
139
140<screen><userinput>make</userinput></screen>
141
142<para>Compilation is now complete. As mentioned earlier, running the
143test suites for the temporary tools installed in this chapter is not
144mandatory. To run the Glibc test suite (if desired), the following
145command will do so:</para>
146
147<screen><userinput>make check</userinput></screen>
148
149<para>For a discussion of test failures that are of particular
150importance, please see <xref linkend="ch-system-glibc"/>.</para>
151
152<para>In this chapter, some tests can be adversely effected by
153existing tools or environmental issues on the host system. Glibc test
154suite failures in this chapter are typically not worrisome. The Glibc
155installed in <xref linkend="chapter-building-system"/> is the one that
156will ultimately end up being used, so that is the one that needs to pass
157most tests (even in <xref linkend="chapter-building-system"/>, some
158failures 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
161reissuing the <command>make check</command> command. The test suite should pick up where it left
162off and continue. This stop-start sequence can be circumvented by
163issuing a <command>make -k check</command> command. If using this option, be sure to log the
164output 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
167end about the absence of /tools/etc/ld.so.conf. Prevent this warning
168with:</para>
169
170<screen><userinput>mkdir /tools/etc
171touch /tools/etc/ld.so.conf</userinput></screen>
172
173<para>Install the package:</para>
174
175<screen><userinput>make install</userinput></screen>
176
177<para>Different countries and cultures have varying conventions for
178how to communicate. These conventions range from the format for
179representing dates and times to more complex issues, such as the
180language spoken. The <quote>internationalization</quote> of GNU
181programs works by locale.</para>
182
183<note><para>If the test suites are not being run in this chapter (as
184per the recommendation), there is no need to install the locales now.
185The appropriate locales will be installed in the next
186chapter.</para></note>
187
188<para>To install the Glibc locales anyway, use the following
189command:</para>
190
191<screen><userinput>make localedata/install-locales</userinput></screen>
192
193<para>To save time, an alternative to running the
194previous command (which generates and installs every locale Glibc is
195aware of) is to install only those locales that are wanted and needed.
196This can be achieved by using the <command>localedef</command>
197command. Information on this command is located in the
198<filename>INSTALL</filename> file in the Glibc source. However, there
199are a number of locales that are essential in order for the tests of
200future packages to pass, in particular, the
201<emphasis>libstdc++</emphasis> tests from GCC. The following
202instructions, instead of the <emphasis>install-locales</emphasis>
203target used above, will install the minimum set of locales necessary
204for the tests to run successfully:</para>
205
206<screen><userinput>mkdir -p /tools/lib/locale
207localedef -i de_DE -f ISO-8859-1 de_DE
208localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
209localedef -i en_HK -f ISO-8859-1 en_HK
210localedef -i en_PH -f ISO-8859-1 en_PH
211localedef -i en_US -f ISO-8859-1 en_US
212localedef -i es_MX -f ISO-8859-1 es_MX
213localedef -i fa_IR -f UTF-8 fa_IR
214localedef -i fr_FR -f ISO-8859-1 fr_FR
215localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
216localedef -i it_IT -f ISO-8859-1 it_IT
217localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
218
219</sect2>
220
221<sect2 role="content"><title/>
222<para>Details on this package are located in <xref linkend="contents-glibc"/>.</para>
223</sect2>
224
225</sect1>
226
Note: See TracBrowser for help on using the repository browser.