source: chapter05/glibc.xml@ 9829329

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 9829329 was 9829329, checked in by Matthew Burgess <matthew@…>, 18 years ago

Remove optimization related warnings from the toolchain packages

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

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