source: chapter05/glibc.xml@ effd9c6

6.1.1
Last change on this file since effd9c6 was 1ec69ac5, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Added nodump attributes.

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

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