2013-03-28 17:57:16 +00:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
|
|
|
|
|
|
|
<sect1 id="ch-tools-libstdcpp" role="wrap">
|
|
|
|
<?dbhtml filename="gcc-libstdc++.html"?>
|
|
|
|
|
|
|
|
<sect1info condition="script">
|
2019-04-10 21:20:22 +01:00
|
|
|
<productname>gcc-libstdc++</productname>
|
2013-03-28 17:57:16 +00:00
|
|
|
<productnumber>&gcc-version;</productnumber>
|
|
|
|
<address>&gcc-url;</address>
|
|
|
|
</sect1info>
|
|
|
|
|
2018-06-20 16:20:49 +01:00
|
|
|
<title>Libstdc++ from GCC-&gcc-version;</title>
|
2013-03-28 17:57:16 +00:00
|
|
|
|
|
|
|
<indexterm zone="ch-tools-libstdcpp">
|
|
|
|
<primary sortas="a-GCC">GCC</primary>
|
|
|
|
<secondary>tools, libstdc++</secondary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title/>
|
|
|
|
|
2018-06-20 16:20:49 +01:00
|
|
|
<para>Libstdc++ is the standard C++ library. It is needed
|
|
|
|
to compile C++ code
|
|
|
|
(part of GCC is written in C++), but we had to defer its installation
|
|
|
|
when we built <xref linkend="ch-tools-gcc-pass1"/>
|
|
|
|
because it depends on glibc, which was not yet available in /tools.
|
|
|
|
</para>
|
2013-03-28 17:57:16 +00:00
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>&buildtime;</segtitle>
|
|
|
|
<segtitle>&diskspace;</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
|
|
|
<seg>&libstdcpp-ch5-sbu;</seg>
|
|
|
|
<seg>&libstdcpp-ch5-du;</seg>
|
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Target Libstdc++</title>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para><application>Libstdc++</application> is part of the GCC sources.
|
|
|
|
You should first unpack the GCC tarball and change to the
|
|
|
|
<filename>gcc-&gcc-version;</filename> directory.</para>
|
|
|
|
</note>
|
|
|
|
|
2016-01-27 21:49:38 +00:00
|
|
|
<para>Create a separate build directory for Libstdc++ and enter it:</para>
|
2013-03-28 17:57:16 +00:00
|
|
|
|
2016-01-27 21:49:38 +00:00
|
|
|
<screen><userinput remap="pre">mkdir -v build
|
|
|
|
cd build</userinput></screen>
|
2013-03-28 17:57:16 +00:00
|
|
|
|
|
|
|
<para>Prepare Libstdc++ for compilation:</para>
|
|
|
|
|
2016-01-27 21:49:38 +00:00
|
|
|
<screen><userinput remap="configure">../libstdc++-v3/configure \
|
2014-02-18 07:16:55 +00:00
|
|
|
--host=$LFS_TGT \
|
|
|
|
--prefix=/tools \
|
|
|
|
--disable-multilib \
|
2020-03-02 08:01:51 +00:00
|
|
|
--disable-nls \<!--
|
|
|
|
- -disable-libstdcxx-threads \-->
|
2014-02-18 07:16:55 +00:00
|
|
|
--disable-libstdcxx-pch \
|
2013-03-28 17:57:16 +00:00
|
|
|
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<title>The meaning of the configure options:</title>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--host=...</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Indicates to use the cross compiler we have just built
|
|
|
|
instead of the one in <filename>/usr/bin</filename>.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2020-03-02 08:01:51 +00:00
|
|
|
<!--
|
2013-03-28 17:57:16 +00:00
|
|
|
<varlistentry>
|
2020-03-02 08:01:51 +00:00
|
|
|
<term><parameter>- -disable-libstdcxx-threads</parameter></term>
|
2013-03-28 17:57:16 +00:00
|
|
|
<listitem>
|
2020-02-23 06:56:18 +00:00
|
|
|
<para>Since gcc-pass1 is built without thread support, the C++
|
|
|
|
thread library cannot be built either.</para>
|
2013-03-28 17:57:16 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2020-03-02 08:01:51 +00:00
|
|
|
-->
|
2013-03-28 17:57:16 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--disable-libstdcxx-pch</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This switch prevents the installation of precompiled
|
|
|
|
include files, which are not needed at this stage.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2014-05-02 17:22:07 +01:00
|
|
|
<term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
|
2013-03-28 17:57:16 +00:00
|
|
|
<listitem>
|
|
|
|
<para>This is the location where the standard include files are
|
|
|
|
searched by the C++ compiler. In a normal build, this information
|
|
|
|
is automatically passed to the Libstdc++ <command>configure</command>
|
2015-11-03 03:48:42 +00:00
|
|
|
options from the top level directory. In our case, this information
|
2013-12-08 03:02:53 +00:00
|
|
|
must be explicitly given.</para>
|
2013-03-28 17:57:16 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
<para>Compile libstdc++ by running:</para>
|
|
|
|
|
|
|
|
<screen><userinput remap="make">make</userinput></screen>
|
|
|
|
|
|
|
|
<para>Install the library:</para>
|
|
|
|
|
|
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="content">
|
|
|
|
<title/>
|
|
|
|
|
|
|
|
<para>Details on this package are located in
|
|
|
|
<xref linkend="contents-gcc" role="."/></para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|