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