source: chapter05/glibc.xml@ 5536f74

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 5536f74 was 5536f74, checked in by Archaic <archaic@…>, 18 years ago

Applied Alexander Patrakov's patch which adds UTF-8 capability to the
development branch of the LFS Book.

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

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