source: chapter05/glibc.xml@ 9684126

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 12.2 12.2-rc1 6.0 6.1 6.1.1 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 v5_1 v5_1_1 xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/multilib xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 9684126 was d0a6c4c, checked in by Greg Schafer <greg@…>, 21 years ago

Upgraded to Glibc-2.3.3, Kbd-1.12, Perl-5.8.3 and Shadow-4.0.4.1.

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

  • Property mode set to 100644
File size: 8.2 KB
Line 
1<sect1 id="ch05-glibc">
2<title>Installing Glibc-&glibc-version;</title>
3<?dbhtml filename="glibc.html" dir="chapter05"?>
4
5<screen>Estimated build time: &glibc-time-tools;
6Estimated required disk space: &glibc-compsize-tools;</screen>
7
8&aa-glibc-down;
9&aa-glibc-dep;
10
11<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
12
13<sect2>
14<title>Installation of Glibc</title>
15
16<para>This package is known to behave badly when you have changed its
17default optimization flags (including the -march and -mcpu options).
18Therefore, if you have defined any environment variables that override
19default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
20them when building Glibc.</para>
21
22<para>Basically, compiling Glibc in any other way than the book suggests
23is putting the stability of your system at risk.</para>
24
25<para>The Glibc documentation recommends building Glibc outside of the source
26directory in a dedicated build directory:</para>
27
28<screen><userinput>mkdir ../glibc-build
29cd ../glibc-build</userinput></screen>
30
31<para>Next, prepare Glibc for compilation:</para>
32
33<screen><userinput>../&glibc-dir;/configure --prefix=/tools \
34&nbsp;&nbsp;&nbsp;&nbsp;--disable-profile --enable-add-ons=linuxthreads \
35&nbsp;&nbsp;&nbsp;&nbsp;--with-headers=/tools/include \
36&nbsp;&nbsp;&nbsp;&nbsp;--with-binutils=/tools/bin \
37&nbsp;&nbsp;&nbsp;&nbsp;--without-gd --without-cvs</userinput></screen>
38
39<para>The meaning of the configure options:</para>
40
41<itemizedlist>
42<listitem><para><userinput>--disable-profile</userinput>: This disables the
43building of the libraries with profiling information. Omit this option if you
44plan to do profiling.</para></listitem>
45
46<listitem><para><userinput>--enable-add-ons=linuxthreads</userinput>: This
47tells Glibc to use the Linuxthreads add-on as its threading
48library.</para></listitem>
49
50<listitem><para><userinput>--with-binutils=/tools/bin</userinput> and
51<userinput>--with-headers=/tools/include</userinput>: Strictly speaking
52these switches are not required. But they ensure nothing can go wrong with
53regard to what kernel headers and Binutils programs get used during the
54Glibc build.</para></listitem>
55
56<listitem><para><userinput>--without-gd</userinput>: This switch ensures
57that we don't build the <userinput>memusagestat</userinput> program, which
58strangely enough insists on linking against the host's libraries (libgd,
59libpng, libz, and so forth).</para></listitem>
60
61<listitem><para><userinput>--without-cvs</userinput>: This is meant to prevent
62the Makefiles from attempting automatic CVS commits when using a CVS snapshot.
63But it's not actually needed these days. We use it because it silences an
64annoying but harmless warning about a missing <filename>autoconf</filename>
65program.</para></listitem>
66</itemizedlist>
67
68<para>During this stage you might see the following warning:</para>
69
70<blockquote><screen>configure: WARNING:
71*** These auxiliary programs are missing or incompatible versions: msgfmt
72*** some features will be disabled.
73*** Check the INSTALL file for required versions.</screen></blockquote>
74
75<para>The missing or incompatible <filename>msgfmt</filename> program is
76generally harmless, but it's believed it can sometimes cause problems when
77running the test suite.</para>
78
79<para>Compile the package:</para>
80
81<screen><userinput>make</userinput></screen>
82
83<para>Compilation is now complete. As discussed earlier, we don't recommend
84running the test suites for the temporary system here in this chapter. If you
85still want to run the Glibc test suite anyway, the following command will do
86so:</para>
87
88<screen><userinput>make check</userinput></screen>
89
90<para>The Glibc test suite is highly dependent on certain functions of your host
91system, in particular the kernel. Additionally, here in this chapter some tests
92can be adversely affected by existing tools or environmental issues on the host
93system. Of course, these won't be a problem when we run the Glibc test suite
94inside the chroot environment of <xref linkend="chapter06"/>. In general, the
95Glibc test suite is always expected to pass. However, as mentioned above, some
96failures are unavoidable in certain circumstances. Here is a list of the most
97common issues we are aware of:</para>
98
99<itemizedlist>
100<listitem><para>The <emphasis>math</emphasis> tests sometimes fail when running
101on systems where the CPU is not a relatively new genuine Intel or authentic AMD.
102Certain optimization settings are also known to be a factor here.</para></listitem>
103
104<listitem><para>The <emphasis>gettext</emphasis> test sometimes fails due to
105host system issues. The exact reasons are not yet clear.</para></listitem>
106
107<listitem><para>The <emphasis>atime</emphasis> test sometimes fails when the
108LFS partition is mounted with the <emphasis>noatime</emphasis> option, or due
109to other file system quirks.</para></listitem>
110
111<listitem><para>The <emphasis>shm</emphasis> test might fail when the host
112system is running the devfs file system but doesn't have the tmpfs file system
113mounted at <filename>/dev/shm</filename> due to lack of support for tmpfs in
114the kernel.</para></listitem>
115
116<listitem><para>When running on older and slower hardware, some tests might
117fail due to test timeouts being exceeded.</para></listitem>
118</itemizedlist>
119
120<para>In summary, don't worry too much if you see Glibc test suite failures
121here in this chapter. The Glibc in <xref linkend="chapter06"/> is the one we'll
122ultimately end up using so that is the one we would really like to see pass.
123But please keep in mind, even in <xref linkend="chapter06"/> some failures
124could still occur -- the <emphasis>math</emphasis>
125tests for example. When experiencing a failure, make a note of it, then
126continue by reissuing the <userinput>make check</userinput>. The test suite
127should pick up where it left off and continue on. You can circumvent this
128stop-start sequence by issuing a <userinput>make -k check</userinput>. But if
129you do that, be sure to log the output so that you can later peruse the log
130file and examine the total number of failures.</para>
131
132<para>Though it is a harmless message, the install stage of Glibc will
133complain about the absence of <filename>/tools/etc/ld.so.conf</filename>.
134Fix this annoying little warning with:</para>
135
136<screen><userinput>mkdir /tools/etc
137touch /tools/etc/ld.so.conf</userinput></screen>
138
139<para>Now install the package:</para>
140
141<screen><userinput>make install</userinput></screen>
142
143<para>Different countries and cultures have varying conventions for how to
144communicate. These conventions range from very simple ones, such as the format
145for representing dates and times, to very complex ones, such as the language
146spoken. The "internationalization" of GNU programs works by means of
147<emphasis>locales</emphasis>.</para>
148
149<note><para>If you are not running the test suites here in this chapter as per
150our recommendation, there is little point in installing the locales now. We'll
151be installing the locales in the next chapter.</para></note>
152
153<para>If you still want to install the Glibc locales anyway, the following
154command will do so:</para>
155
156<screen><userinput>make localedata/install-locales</userinput></screen>
157
158<para>An alternative to running the previous command is to install only those
159locales which you need or want. This can be achieved by using the
160<userinput>localedef</userinput> command. Information on this can be found in
161the <filename>INSTALL</filename> file in the Glibc source. However, there are
162a number of locales that are essential for the tests of future packages to
163pass, in particular, the <emphasis>libstdc++</emphasis> tests from GCC. The
164following instructions, instead of the install-locales target above, will
165install the minimum set of locales necessary for the tests to run
166successfully:</para>
167
168<screen><userinput>mkdir -p /tools/lib/locale
169localedef -i de_DE -f ISO-8859-1 de_DE
170localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
171localedef -i en_HK -f ISO-8859-1 en_HK
172localedef -i en_PH -f ISO-8859-1 en_PH
173localedef -i en_US -f ISO-8859-1 en_US
174localedef -i es_MX -f ISO-8859-1 es_MX
175localedef -i fr_FR -f ISO-8859-1 fr_FR
176localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
177localedef -i it_IT -f ISO-8859-1 it_IT
178localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
179
180</sect2>
181
182<sect2><title>&nbsp;</title><para>&nbsp;</para>
183<para>The details on this package are found in <xref linkend="contents-glibc"/>.</para>
184<para>&nbsp;</para></sect2>
185
186</sect1>
187
Note: See TracBrowser for help on using the repository browser.