source: chapter05/glibc.xml@ cf9080d

Last change on this file since cf9080d was ceaa2a7, checked in by Matthew Burgess <matthew@…>, 19 years ago

Added patches necessary for chapter 5's Glibc to compile with GCC-4.x

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

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