source: chapter05/glibc.xml@ 578fb81b

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 578fb81b was 578fb81b, checked in by Matthew Burgess <matthew@…>, 19 years ago

Fix typos related to kernel versions triggering glibc test failures

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