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