2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-03-21 18:42:58 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2006-01-20 21:02:23 +00:00
|
|
|
|
2004-05-16 01:06:08 +01:00
|
|
|
<sect1 id="ch-tools-glibc" role="wrap">
|
2006-01-20 21:02:23 +00:00
|
|
|
<?dbhtml filename="glibc.html"?>
|
|
|
|
|
2007-09-07 20:16:43 +01:00
|
|
|
<sect1info condition="script">
|
|
|
|
<productname>glibc</productname>
|
|
|
|
<productnumber>&glibc-version;</productnumber>
|
|
|
|
<address>&glibc-url;</address>
|
|
|
|
</sect1info>
|
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<title>Glibc-&glibc-version;</title>
|
|
|
|
|
|
|
|
<indexterm zone="ch-tools-glibc">
|
|
|
|
<primary sortas="a-Glibc">Glibc</primary>
|
|
|
|
<secondary>tools</secondary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title/>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
|
|
|
href="../chapter06/glibc.xml"
|
|
|
|
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>&buildtime;</segtitle>
|
|
|
|
<segtitle>&diskspace;</segtitle>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<seglistitem>
|
2006-05-14 21:16:56 +01:00
|
|
|
<seg>&glibc-ch5-sbu;</seg>
|
|
|
|
<seg>&glibc-ch5-du;</seg>
|
2006-01-20 21:02:23 +00:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
</sect2>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Glibc</title>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>The Glibc documentation recommends building Glibc outside of the source
|
|
|
|
directory in a dedicated build directory:</para>
|
2004-12-22 12:06:22 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="pre">mkdir -v ../glibc-build
|
2003-11-01 22:31:50 +00:00
|
|
|
cd ../glibc-build</userinput></screen>
|
|
|
|
|
2007-09-16 01:21:26 +01:00
|
|
|
<para>Because Glibc no longer supports i386, its developers say to use the
|
|
|
|
compiler flag <parameter>-march=i486</parameter> when building it for x86
|
|
|
|
machines. There are several ways to accomplish that, but testing shows that
|
|
|
|
the flag is best placed inside the build variable <quote>CFLAGS</quote>.
|
|
|
|
Instead of overriding completely what Glibc's internal build system uses
|
|
|
|
for CFLAGS, append the new flag to the existing contents of CFLAGS by
|
2008-04-23 19:33:53 +01:00
|
|
|
making use of the special file <filename>configparms</filename>. The
|
|
|
|
-mtune=native flag is also necessary to reset a reasonable value for -mtune
|
|
|
|
that is changed when setting -march.</para>
|
2007-09-16 01:21:26 +01:00
|
|
|
|
2008-12-03 22:46:04 +00:00
|
|
|
<screen><userinput remap="configure">case `uname -m` in
|
|
|
|
i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
|
|
|
|
esac</userinput></screen>
|
2007-09-16 01:21:26 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>Next, prepare Glibc for compilation:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="configure">../glibc-&glibc-version;/configure --prefix=/tools \
|
2008-12-05 20:46:02 +00:00
|
|
|
--host=$LFS_TGT --build=$(../glibc-&glibc-version;/scripts/config.guess) \
|
2005-12-26 19:46:12 +00:00
|
|
|
--disable-profile --enable-add-ons \
|
2009-06-07 00:38:23 +01:00
|
|
|
--enable-kernel=2.6.18 --with-headers=/tools/include \
|
2008-12-05 20:46:02 +00:00
|
|
|
libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<variablelist>
|
|
|
|
<title>The meaning of the configure options:</title>
|
|
|
|
|
2008-12-05 20:46:02 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--host=$LFS_TGT, --build=$(../glibc-&glibc-version;/scripts/config.guess)</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>The combined effect of these switches is that Glibc's build system
|
|
|
|
configures itself to cross-compile, using the cross-linker and
|
|
|
|
cross-compiler in <filename class="directory">/tools</filename>.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--disable-profile</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This builds the libraries without profiling information. Omit
|
|
|
|
this option if profiling on the temporary tools is necessary.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--enable-add-ons</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This tells Glibc to use the NPTL add-on as its threading
|
|
|
|
library.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2009-06-07 00:38:23 +01:00
|
|
|
<term><parameter>--enable-kernel=2.6.18</parameter></term>
|
2006-01-20 21:02:23 +00:00
|
|
|
<listitem>
|
|
|
|
<para>This tells Glibc to compile the library with support
|
2009-06-07 00:38:23 +01:00
|
|
|
for 2.6.18 and later Linux kernels. Workarounds for older
|
|
|
|
kernels are not enabled.</para>
|
2006-01-20 21:02:23 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--with-headers=/tools/include</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This tells Glibc to compile itself against the headers recently
|
|
|
|
installed to the tools directory, so that it knows exactly what
|
|
|
|
features the kernel has and can optimize itself accordingly.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2008-12-05 20:46:02 +00:00
|
|
|
<term><parameter>libc_cv_forced_unwind=yes</parameter></term>
|
2006-01-20 21:02:23 +00:00
|
|
|
<listitem>
|
2008-12-05 20:46:02 +00:00
|
|
|
<para>The build requires support for forced unwind, but because it is
|
|
|
|
being cross compiled, it cannot auto detect it. Setting this variable
|
2009-03-12 21:09:00 +00:00
|
|
|
on the command line explicitly tells the
|
|
|
|
<command>configure</command> script that support is available.</para>
|
2008-12-05 20:46:02 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>libc_cv_c_cleanup=yes</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>The build also requires support for C cleanup handling, which it
|
|
|
|
cannot auto detect when being cross compiled. Enable it explicitly.</para>
|
2006-01-20 21:02:23 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
<para>During this stage the following warning might appear:</para>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<screen><computeroutput>configure: WARNING:
|
|
|
|
*** These auxiliary programs are missing or
|
2005-02-19 22:16:42 +00:00
|
|
|
*** incompatible versions: msgfmt
|
|
|
|
*** some features will be disabled.
|
2006-01-20 21:02:23 +00:00
|
|
|
*** Check the INSTALL file for required versions.</computeroutput></screen>
|
|
|
|
</blockquote>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>The missing or incompatible <command>msgfmt</command> program is
|
2009-08-12 20:16:30 +01:00
|
|
|
generally harmless. This <command>msgfmt</command> program is part of the
|
|
|
|
Gettext package which the host distribution should provide.</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>Compile the package:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="make">make</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2008-10-12 00:39:51 +01:00
|
|
|
<para>This package does come with a test suite, however, it cannot be
|
|
|
|
run at this time because we do not have a C++ compiler yet.</para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2009-05-27 02:45:59 +01:00
|
|
|
<note>
|
|
|
|
<para>The test suite also requires locale data to be installed in order to run
|
2009-05-27 18:23:52 +01:00
|
|
|
successfully. Locale data provides information to the system regarding
|
2009-05-27 02:45:59 +01:00
|
|
|
such things as the date, time, and currency formats accepted and output by
|
|
|
|
system utilities. If the test suites are not being run in this chapter
|
|
|
|
(as per the recommendation), there is no need to install the locales now.
|
|
|
|
The appropriate locales will be installed in the next chapter. To install
|
|
|
|
the Glibc locales anyway, use instructions from <xref
|
|
|
|
linkend="ch-system-glibc" role="."/></para>
|
|
|
|
</note>
|
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>Install the package:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
</sect2>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<sect2 role="content">
|
|
|
|
<title/>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<para>Details on this package are located in
|
|
|
|
<xref linkend="contents-glibc" role="."/></para>
|
|
|
|
|
|
|
|
</sect2>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
</sect1>
|