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
|
|
|
|
2010-04-21 21:16:28 +01:00
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
2006-01-20 21:02:23 +00:00
|
|
|
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>
|
2015-08-23 22:26:36 +01:00
|
|
|
|
2016-01-27 21:49:38 +00:00
|
|
|
<para>The Glibc documentation recommends building Glibc
|
|
|
|
in a dedicated build directory:</para>
|
2012-03-29 07:46:19 +01:00
|
|
|
|
2016-01-27 21:49:38 +00:00
|
|
|
<screen><userinput remap="pre">mkdir -v build
|
|
|
|
cd build</userinput></screen>
|
2012-08-05 15:25:02 +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
|
|
|
|
2016-01-31 16:32:45 +00:00
|
|
|
<screen><userinput remap="configure">../configure \
|
|
|
|
--prefix=/tools \
|
|
|
|
--host=$LFS_TGT \
|
|
|
|
--build=$(../scripts/config.guess) \
|
2019-02-06 20:14:49 +00:00
|
|
|
--enable-kernel=&min-kernel; \
|
|
|
|
--with-headers=/tools/include</userinput></screen>
|
|
|
|
<!--
|
2016-01-31 16:32:45 +00:00
|
|
|
libc_cv_forced_unwind=yes \
|
2019-02-06 20:14:49 +00:00
|
|
|
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>
|
2016-01-31 16:24:19 +00:00
|
|
|
<term><parameter>--host=$LFS_TGT, --build=$(../scripts/config.guess)</parameter></term>
|
2008-12-05 20:46:02 +00:00
|
|
|
<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>
|
2016-05-24 22:24:59 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<varlistentry>
|
2013-08-22 16:17:25 +01:00
|
|
|
<term><parameter>--enable-kernel=&min-kernel;</parameter></term>
|
2006-01-20 21:02:23 +00:00
|
|
|
<listitem>
|
|
|
|
<para>This tells Glibc to compile the library with support
|
2013-08-22 16:17:25 +01:00
|
|
|
for &min-kernel; and later Linux kernels. Workarounds for older
|
2009-06-07 00:38:23 +01:00
|
|
|
kernels are not enabled.</para>
|
2006-01-20 21:02:23 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2016-05-24 22:24:59 +01:00
|
|
|
|
2006-01-20 21:02:23 +00:00
|
|
|
<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>
|
2019-02-06 20:14:49 +00:00
|
|
|
<!--
|
2006-01-20 21:02:23 +00:00
|
|
|
<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>
|
2010-01-26 18:17:27 +00:00
|
|
|
<para>The linker installed during
|
|
|
|
<xref linkend="ch-tools-binutils-pass1"/> was cross-compiled and as
|
|
|
|
such cannot be used until Glibc has been installed. This means that
|
|
|
|
the configure test for force-unwind support will fail, as it relies on
|
|
|
|
a working linker. The libc_cv_forced_unwind=yes variable is passed in
|
|
|
|
order to inform <command>configure</command> that force-unwind
|
|
|
|
support is available without it having to run the test.</para>
|
2008-12-05 20:46:02 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>libc_cv_c_cleanup=yes</parameter></term>
|
|
|
|
<listitem>
|
2015-11-03 03:48:42 +00:00
|
|
|
<para>Similarly, we pass libc_cv_c_cleanup=yes through to the
|
2010-01-26 18:17:27 +00:00
|
|
|
<command>configure</command> script so that the test is skipped and C
|
|
|
|
cleanup handling support is configured.</para>
|
2006-01-20 21:02:23 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2019-02-06 20:14:49 +00:00
|
|
|
-->
|
2016-08-06 16:00:51 +01:00
|
|
|
<!-- <varlistentry>
|
2012-03-26 21:29:25 +01:00
|
|
|
<term><parameter>libc_cv_ctors_header=yes</parameter></term>
|
|
|
|
<listitem>
|
2015-11-03 03:48:42 +00:00
|
|
|
<para>Similarly, we pass libc_cv_ctors_header=yes through to the
|
2012-03-26 21:29:25 +01:00
|
|
|
<command>configure</command> script so that the test is skipped and
|
|
|
|
gcc constructor support is configured.</para>
|
|
|
|
</listitem>
|
2016-08-06 16:00:51 +01:00
|
|
|
</varlistentry>-->
|
2006-01-20 21:02:23 +00:00
|
|
|
|
|
|
|
</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
|
|
|
|
2015-02-16 21:32:19 +00:00
|
|
|
<note><para>There have been reports that this package may fail when
|
|
|
|
building as a "parallel make". If this occurs, rerun the make command
|
|
|
|
with a "-j1" option.</para></note>
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-04-25 20:26:21 +01:00
|
|
|
<caution>
|
|
|
|
<para>At this point, it is imperative to stop and ensure that the basic
|
|
|
|
functions (compiling and linking) of the new toolchain are working as
|
|
|
|
expected. To perform a sanity check, run the following commands:</para>
|
|
|
|
|
2015-09-23 20:13:55 +01:00
|
|
|
<screen><userinput>echo 'int main(){}' > dummy.c
|
2012-04-25 20:26:21 +01:00
|
|
|
$LFS_TGT-gcc dummy.c
|
|
|
|
readelf -l a.out | grep ': /tools'</userinput></screen>
|
|
|
|
|
|
|
|
<para>If everything is working correctly, there should be no errors,
|
|
|
|
and the output of the last command will be of the form:</para>
|
|
|
|
|
2018-02-26 18:48:55 +00:00
|
|
|
<screen><computeroutput>[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
|
2012-04-25 20:26:21 +01:00
|
|
|
|
2018-02-26 18:48:55 +00:00
|
|
|
<para>Note that for 32-bit machines, the interpreter name will be
|
|
|
|
<filename>/tools/lib/ld-linux.so.2</filename>.</para>
|
2012-04-25 20:26:21 +01:00
|
|
|
|
|
|
|
<para>If the output is not shown as above or there was no output at all,
|
|
|
|
then something is wrong. Investigate and retrace the steps to find out
|
|
|
|
where the problem is and correct it. This issue must be resolved before
|
2012-05-06 11:02:42 +01:00
|
|
|
continuing on.</para>
|
2012-04-25 20:26:21 +01:00
|
|
|
|
|
|
|
<para>Once all is well, clean up the test files:</para>
|
|
|
|
|
|
|
|
<screen><userinput>rm -v dummy.c a.out</userinput></screen>
|
|
|
|
|
|
|
|
</caution>
|
|
|
|
|
2013-09-01 00:19:17 +01:00
|
|
|
<note><para>Building Binutils in the section after next will serve as an
|
|
|
|
additional check that the toolchain has been built properly. If Binutils
|
|
|
|
fails to build, it is an indication that something has gone wrong with the
|
|
|
|
previous Binutils, GCC, or Glibc installations.</para></note>
|
2012-04-25 20:26:21 +01: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>
|