1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE section [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <section xmlns="http://docbook.org/docbook-ng"
|
---|
7 | xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
8 | xml: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 | <section role="package"><title/>
|
---|
17 | <xi:include href="../chapter06/glibc.xml" xpointer="xpointer(/*[1]/*[3]/*[2])"/>
|
---|
18 |
|
---|
19 | <segmentedlist>
|
---|
20 | <segtitle>&buildtime;</segtitle>
|
---|
21 | <segtitle>&diskspace;</segtitle>
|
---|
22 | <seglistitem><seg>11.8 SBU</seg><seg>800 MB</seg></seglistitem>
|
---|
23 | </segmentedlist>
|
---|
24 |
|
---|
25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/glibc.xml" xpointer="xpointer(/*[1]/*[3]/*[4])"/>
|
---|
26 |
|
---|
27 | </section>
|
---|
28 |
|
---|
29 | <section role="installation">
|
---|
30 | <title>Installation of Glibc</title>
|
---|
31 |
|
---|
32 | <para>This package is known to behave badly when you change its default
|
---|
33 | optimization flags (including the <parameter>-march</parameter> and
|
---|
34 | <parameter>-mcpu</parameter> options). Therefore, if you have defined any
|
---|
35 | environment variables that override default optimizations, such as CFLAGS and
|
---|
36 | CXXFLAGS, we recommend un-setting them when building Glibc.</para>
|
---|
37 |
|
---|
38 | <para>Basically, compiling Glibc in any other way than the book suggests
|
---|
39 | is putting the stability of your system at 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 \
|
---|
51 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \
|
---|
52 | --without-gd --without-cvs --with-headers=/tools/include</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
|
---|
60 | libraries without profiling information. Omit this option if you plan to do
|
---|
61 | profiling on the temporary tools.</para></listitem>
|
---|
62 | </varlistentry>
|
---|
63 |
|
---|
64 | <varlistentry>
|
---|
65 | <term><parameter>--enable-add-ons</parameter></term>
|
---|
66 | <listitem><para>This tells Glibc to use the add-on' that it can use like NPTL
|
---|
67 | as its threading library.</para></listitem>
|
---|
68 | </varlistentry>
|
---|
69 |
|
---|
70 | <varlistentry>
|
---|
71 | <term><parameter>--enable-kernel=2.6.0</parameter></term>
|
---|
72 | <listitem><para>This tells Glibc to compile the library for support of
|
---|
73 | linux 2.6.x kernels.
|
---|
74 | </para></listitem>
|
---|
75 | </varlistentry>
|
---|
76 |
|
---|
77 | <varlistentry>
|
---|
78 | <term><parameter>--with-binutils=/tools/bin</parameter></term>
|
---|
79 | <listitem><para>Strictly speaking this switch is not required. But it does ensure
|
---|
80 | nothing can go wrong with regard to what Binutils programs get used during the
|
---|
81 | Glibc build.</para></listitem>
|
---|
82 | </varlistentry>
|
---|
83 |
|
---|
84 | <varlistentry>
|
---|
85 | <term><parameter>--without-gd</parameter></term>
|
---|
86 | <listitem><para>This prevents the build of the <command>memusagestat</command>
|
---|
87 | program, which strangely enough insists on linking against the host's libraries
|
---|
88 | (libgd, libpng, libz, and so forth). </para></listitem>
|
---|
89 | </varlistentry>
|
---|
90 |
|
---|
91 | <varlistentry>
|
---|
92 | <term><parameter>--without-cvs</parameter></term>
|
---|
93 | <listitem><para>This is meant to prevent
|
---|
94 | the Makefiles from attempting automatic CVS checkouts when using a CVS
|
---|
95 | snapshot. But it's not actually needed these days. We use it because it
|
---|
96 | suppresses an annoying but harmless warning about a missing
|
---|
97 | <command>autoconf</command> program.</para></listitem>
|
---|
98 | </varlistentry>
|
---|
99 |
|
---|
100 | <varlistentry>
|
---|
101 | <term><parameter>--with-headers=/tools/include</parameter></term>
|
---|
102 | <listitem><para>This forces glibc to use the linux-libc-headers installed
|
---|
103 | in /tools/include, rather than those on the host, which may be too old to
|
---|
104 | support needed functionality.</para></listitem>
|
---|
105 | </varlistentry>
|
---|
106 |
|
---|
107 | </variablelist>
|
---|
108 |
|
---|
109 | <para>During this stage you might see the following warning:</para>
|
---|
110 |
|
---|
111 | <blockquote><screen><computeroutput>configure: WARNING:
|
---|
112 | *** These auxiliary programs are missing or incompatible versions: msgfmt
|
---|
113 | *** some features will be disabled.
|
---|
114 | *** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>
|
---|
115 |
|
---|
116 | <para>The missing or incompatible <command>msgfmt</command> program is
|
---|
117 | generally harmless, but it's believed it can sometimes cause problems when
|
---|
118 | running the test suite.</para>
|
---|
119 |
|
---|
120 | <para>Compile the package:</para>
|
---|
121 |
|
---|
122 | <screen><userinput>make</userinput></screen>
|
---|
123 |
|
---|
124 | <para>Compilation is now complete. As mentioned earlier, running the test suites
|
---|
125 | for the temporary tools installed in this chapter is not mandatory. If you want
|
---|
126 | to run the Glibc test suite though, the following command will do so:</para>
|
---|
127 |
|
---|
128 | <screen><userinput>make check</userinput></screen>
|
---|
129 |
|
---|
130 | <para>For a discussion of test failures that are of particular
|
---|
131 | importance, please see <xref linkend="ch-system-glibc"/>.</para>
|
---|
132 |
|
---|
133 | <para>In this chapter, some tests can be adversely affected by existing tools or
|
---|
134 | environmental issues on the host system. In short, don't worry too much if you
|
---|
135 | see Glibc test suite failures in this chapter. The Glibc in
|
---|
136 | <xref linkend="chapter-building-system"/> is the one we'll ultimately end up
|
---|
137 | using, so that is the one we would really like to see pass the tests (but even
|
---|
138 | there some failures could still occur -- the <emphasis>math</emphasis> tests,
|
---|
139 | for example).</para>
|
---|
140 |
|
---|
141 | <para>When experiencing a failure, make a note of it, then continue by reissuing
|
---|
142 | the <command>make check</command>. The test suite should pick up where it left
|
---|
143 | off and continue. You can circumvent this stop-start sequence by issuing a
|
---|
144 | <command>make -k check</command>. If you do that though, be sure to log the
|
---|
145 | output so that you can later peruse the log file and examine the total number of
|
---|
146 | failures.</para>
|
---|
147 |
|
---|
148 | <para>Though it is a harmless message, the install stage of Glibc will at the
|
---|
149 | end complain about the absence of <filename>/tools/etc/ld.so.conf</filename>.
|
---|
150 | Prevent this confusing little warning with:</para>
|
---|
151 |
|
---|
152 | <screen><userinput>mkdir /tools/etc
|
---|
153 | touch /tools/etc/ld.so.conf</userinput></screen>
|
---|
154 |
|
---|
155 | <para>Now install the package:</para>
|
---|
156 |
|
---|
157 | <screen><userinput>make install</userinput></screen>
|
---|
158 |
|
---|
159 | <para>Different countries and cultures have varying conventions for how to
|
---|
160 | communicate. These conventions range from very simple ones, such as the format
|
---|
161 | for representing dates and times, to very complex ones, such as the language
|
---|
162 | spoken. The <quote>internationalization</quote> of GNU programs works by means
|
---|
163 | of <emphasis>locales</emphasis>.</para>
|
---|
164 |
|
---|
165 | <note><para>If you are not running the test suites here in this chapter as per
|
---|
166 | our recommendation, there is little point in installing the locales now. We'll
|
---|
167 | be installing the locales in the next chapter.</para></note>
|
---|
168 |
|
---|
169 | <para>If you still want to install the Glibc locales anyway, the following
|
---|
170 | command will do so:</para>
|
---|
171 |
|
---|
172 | <screen><userinput>make localedata/install-locales</userinput></screen>
|
---|
173 |
|
---|
174 | <para>An alternative to running the previous command is to install only those
|
---|
175 | locales which you need or want. This can be achieved by using the
|
---|
176 | <command>localedef</command> command. Information on this can be found in
|
---|
177 | the <filename>INSTALL</filename> file in the Glibc source. However, there are
|
---|
178 | a number of locales that are essential for the tests of future packages to
|
---|
179 | pass, in particular, the <emphasis>libstdc++</emphasis> tests from GCC. The
|
---|
180 | following instructions, instead of the install-locales target above, will
|
---|
181 | install the minimum set of locales necessary for the tests to run
|
---|
182 | successfully:</para>
|
---|
183 |
|
---|
184 | <screen><userinput>mkdir -p /tools/lib/locale
|
---|
185 | localedef -i de_DE -f ISO-8859-1 de_DE
|
---|
186 | localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
---|
187 | localedef -i en_HK -f ISO-8859-1 en_HK
|
---|
188 | localedef -i en_PH -f ISO-8859-1 en_PH
|
---|
189 | localedef -i en_US -f ISO-8859-1 en_US
|
---|
190 | localedef -i es_MX -f ISO-8859-1 es_MX
|
---|
191 | localedef -i fa_IR -f UTF-8 fa_IR
|
---|
192 | localedef -i fr_FR -f ISO-8859-1 fr_FR
|
---|
193 | localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
---|
194 | localedef -i it_IT -f ISO-8859-1 it_IT
|
---|
195 | localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
---|
196 |
|
---|
197 | </section>
|
---|
198 |
|
---|
199 | <section role="content"><title/>
|
---|
200 | <para>The details on this package are found in <xref linkend="contents-glibc"/>.</para>
|
---|
201 | </section>
|
---|
202 |
|
---|
203 | </section>
|
---|