source: chapter05/glibc.xml@ 6a1593df

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

Using a list of archs for common stuff in chapter05.

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

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