source: chapter05/glibc.xml@ 554b366

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 554b366 was d0dfce4, checked in by Gerard Beekmans <gerard@…>, 21 years ago

Revert Alex's changes back to previous state

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

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