[89afa22] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[459d493] | 8 | <sect1 id="ch-tools-libstdcpp" role="wrap">
|
---|
| 9 | <?dbhtml filename="gcc-libstdc++.html"?>
|
---|
[89afa22] | 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
[714599f] | 12 | <productname>gcc-libstdc++</productname>
|
---|
[89afa22] | 13 | <productnumber>&gcc-version;</productnumber>
|
---|
| 14 | <address>&gcc-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[459d493] | 17 | <title>Libstdc++ from GCC-&gcc-version;</title>
|
---|
[89afa22] | 18 |
|
---|
[459d493] | 19 | <indexterm zone="ch-tools-libstdcpp">
|
---|
[89afa22] | 20 | <primary sortas="a-GCC">GCC</primary>
|
---|
[6dfcfecc] | 21 | <secondary>tools, libstdc++ pass 1</secondary>
|
---|
[89afa22] | 22 | </indexterm>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="package">
|
---|
| 25 | <title/>
|
---|
| 26 |
|
---|
[a26f29f] | 27 | <para>Libstdc++ is the standard C++ library. It is needed
|
---|
[1067bac] | 28 | to compile C++ code
|
---|
| 29 | (part of GCC is written in C++), but we had to defer its installation
|
---|
| 30 | when we built <xref linkend="ch-tools-gcc-pass1"/>
|
---|
[6dfcfecc] | 31 | because it depends on glibc, which was not yet available in the target
|
---|
| 32 | directory.
|
---|
[1067bac] | 33 | </para>
|
---|
[89afa22] | 34 |
|
---|
| 35 | <segmentedlist>
|
---|
| 36 | <segtitle>&buildtime;</segtitle>
|
---|
| 37 | <segtitle>&diskspace;</segtitle>
|
---|
| 38 |
|
---|
| 39 | <seglistitem>
|
---|
[6dfcfecc] | 40 | <seg>&libstdcpp-tmpp1-sbu;</seg>
|
---|
| 41 | <seg>&libstdcpp-tmpp1-du;</seg>
|
---|
[89afa22] | 42 | </seglistitem>
|
---|
| 43 | </segmentedlist>
|
---|
| 44 |
|
---|
| 45 | </sect2>
|
---|
| 46 |
|
---|
| 47 | <sect2 role="installation">
|
---|
| 48 | <title>Installation of Target Libstdc++</title>
|
---|
| 49 |
|
---|
| 50 | <note>
|
---|
| 51 | <para><application>Libstdc++</application> is part of the GCC sources.
|
---|
| 52 | You should first unpack the GCC tarball and change to the
|
---|
| 53 | <filename>gcc-&gcc-version;</filename> directory.</para>
|
---|
| 54 | </note>
|
---|
| 55 |
|
---|
[6dfcfecc] | 56 | <para>Create a separate build directory for libstdc++ and enter it:</para>
|
---|
[89afa22] | 57 |
|
---|
[f1dd547] | 58 | <screen><userinput remap="pre">mkdir -v build
|
---|
| 59 | cd build</userinput></screen>
|
---|
[89afa22] | 60 |
|
---|
[6dfcfecc] | 61 | <para>Prepare libstdc++ for compilation:</para>
|
---|
[89afa22] | 62 |
|
---|
[377270b] | 63 | <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
|
---|
| 64 | arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
|
---|
| 65 | arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
|
---|
| 66 | arch="ml_all">mlist=m64,m32,mx32</userinput>
|
---|
| 67 | <userinput remap="configure">../libstdc++-v3/configure \
|
---|
| 68 | --host=$LFS_TGT \
|
---|
| 69 | --build=$(../config.guess) \
|
---|
| 70 | --prefix=/usr \
|
---|
| 71 | --enable-multilib \
|
---|
| 72 | --with-multilib-list=$mlist \
|
---|
| 73 | --disable-nls \
|
---|
| 74 | --disable-libstdcxx-pch \
|
---|
| 75 | --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
|
---|
| 76 | <screen arch="default"><userinput remap="configure">../libstdc++-v3/configure \
|
---|
[3dc9543] | 77 | --host=$LFS_TGT \
|
---|
[6dfcfecc] | 78 | --build=$(../config.guess) \
|
---|
| 79 | --prefix=/usr \
|
---|
[3dc9543] | 80 | --disable-multilib \
|
---|
[6dfcfecc] | 81 | --disable-nls \
|
---|
[3dc9543] | 82 | --disable-libstdcxx-pch \
|
---|
[89afa22] | 83 | --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
|
---|
| 84 |
|
---|
| 85 | <variablelist>
|
---|
| 86 | <title>The meaning of the configure options:</title>
|
---|
| 87 |
|
---|
| 88 | <varlistentry>
|
---|
| 89 | <term><parameter>--host=...</parameter></term>
|
---|
| 90 | <listitem>
|
---|
[ceebda5] | 91 | <para>Specifies that the cross compiler we have just built
|
---|
| 92 | should be used instead of the one in
|
---|
| 93 | <filename>/usr/bin</filename>.</para>
|
---|
[89afa22] | 94 | </listitem>
|
---|
| 95 | </varlistentry>
|
---|
[6dfcfecc] | 96 |
|
---|
| 97 | <varlistentry arch="ml_32,ml_x32,ml_all">
|
---|
| 98 | <term><parameter>--disable-multilib</parameter></term>
|
---|
[89afa22] | 99 | <listitem>
|
---|
[6dfcfecc] | 100 | <para>Even when building the multilib version, this switch is
|
---|
| 101 | given. This is because the additionally built libraries are
|
---|
| 102 | not required in this stage and some disk space and compile
|
---|
| 103 | time can be saved.</para>
|
---|
[89afa22] | 104 | </listitem>
|
---|
| 105 | </varlistentry>
|
---|
[6dfcfecc] | 106 |
|
---|
[89afa22] | 107 | <varlistentry>
|
---|
| 108 | <term><parameter>--disable-libstdcxx-pch</parameter></term>
|
---|
| 109 | <listitem>
|
---|
| 110 | <para>This switch prevents the installation of precompiled
|
---|
| 111 | include files, which are not needed at this stage.</para>
|
---|
| 112 | </listitem>
|
---|
| 113 | </varlistentry>
|
---|
| 114 |
|
---|
| 115 | <varlistentry>
|
---|
[c5be634] | 116 | <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
|
---|
[89afa22] | 117 | <listitem>
|
---|
[174d1bf] | 118 | <para>This specifies the installation directory for include files.
|
---|
| 119 | Because libstdc++ is the standard C++ library for LFS, this
|
---|
| 120 | directory should match the location where the C++ compiler
|
---|
| 121 | (<command>$LFS_TGT-g++</command>) would search for the
|
---|
| 122 | standard C++ include files. In a normal build, this information
|
---|
[6dfcfecc] | 123 | is automatically passed to the libstdc++ <command>configure</command>
|
---|
[edbeeb5] | 124 | options from the top level directory. In our case, this information
|
---|
[174d1bf] | 125 | must be explicitly given.
|
---|
| 126 | The C++ compiler will prepend the sysroot path
|
---|
| 127 | <filename class="directory">$LFS</filename> (specified building
|
---|
| 128 | GCC pass 1) to the include file search path, so it will actually
|
---|
| 129 | search in
|
---|
[2cf3c176] | 130 | <filename class="directory">$LFS/tools/$LFS_TGT/include/c++/&gcc-version;</filename>.
|
---|
| 131 | The combination of the <parameter>DESTDIR</parameter>
|
---|
[174d1bf] | 132 | variable (in the <command>make install</command> command below)
|
---|
| 133 | and this switch ensures to install the headers there.</para>
|
---|
[89afa22] | 134 | </listitem>
|
---|
| 135 | </varlistentry>
|
---|
| 136 |
|
---|
| 137 | </variablelist>
|
---|
| 138 |
|
---|
| 139 | <para>Compile libstdc++ by running:</para>
|
---|
| 140 |
|
---|
| 141 | <screen><userinput remap="make">make</userinput></screen>
|
---|
| 142 |
|
---|
| 143 | <para>Install the library:</para>
|
---|
| 144 |
|
---|
[6dfcfecc] | 145 | <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
|
---|
[89afa22] | 146 |
|
---|
| 147 | </sect2>
|
---|
| 148 |
|
---|
| 149 | <sect2 role="content">
|
---|
| 150 | <title/>
|
---|
| 151 |
|
---|
| 152 | <para>Details on this package are located in
|
---|
| 153 | <xref linkend="contents-gcc" role="."/></para>
|
---|
| 154 |
|
---|
| 155 | </sect2>
|
---|
| 156 |
|
---|
| 157 | </sect1>
|
---|