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