[6dfcfecc] | 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 |
|
---|
| 8 | <sect1 id="ch-tools-libstdcpp-pass2" role="wrap">
|
---|
| 9 | <?dbhtml filename="gcc-libstdc++-pass2.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
| 12 | <productname>gcc-libstdc++</productname>
|
---|
| 13 | <productnumber>&gcc-version;</productnumber>
|
---|
| 14 | <address>&gcc-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
| 17 | <title>Libstdc++ from GCC-&gcc-version;, Pass 2</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-tools-libstdcpp-pass2">
|
---|
| 20 | <primary sortas="a-GCC">GCC</primary>
|
---|
| 21 | <secondary>tools, libstdc++ pass 2</secondary>
|
---|
| 22 | </indexterm>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="package">
|
---|
| 25 | <title/>
|
---|
| 26 |
|
---|
| 27 | <para>When building <xref linkend="ch-tools-gcc-pass2"/> we had to defer
|
---|
| 28 | the installation of the C++ standard library because no suitable compiler
|
---|
| 29 | was available to compile it. We could not use the compiler built in that
|
---|
| 30 | section because it is a native compiler and should not be used outside of
|
---|
| 31 | chroot and risks polluting the libraries with some host components.</para>
|
---|
| 32 |
|
---|
| 33 | <segmentedlist>
|
---|
| 34 | <segtitle>&buildtime;</segtitle>
|
---|
| 35 | <segtitle>&diskspace;</segtitle>
|
---|
| 36 |
|
---|
| 37 | <seglistitem>
|
---|
| 38 | <seg>&libstdcpp-tmpp2-sbu;</seg>
|
---|
| 39 | <seg>&libstdcpp-tmpp2-du;</seg>
|
---|
| 40 | </seglistitem>
|
---|
| 41 | </segmentedlist>
|
---|
| 42 |
|
---|
| 43 | </sect2>
|
---|
| 44 |
|
---|
| 45 | <sect2 role="installation">
|
---|
| 46 | <title>Installation of Target Libstdc++</title>
|
---|
| 47 |
|
---|
| 48 | <note>
|
---|
| 49 | <para><application>Libstdc++</application> is part of the GCC sources.
|
---|
| 50 | You should first unpack the GCC tarball and change to the
|
---|
| 51 | <filename>gcc-&gcc-version;</filename> directory.</para>
|
---|
| 52 | </note>
|
---|
| 53 |
|
---|
| 54 | <para>Create a link which exists when building libstdc++ in the gcc tree:</para>
|
---|
| 55 |
|
---|
| 56 | <screen><userinput remap="pre">ln -s gthr-posix.h libgcc/gthr-default.h</userinput></screen>
|
---|
| 57 |
|
---|
| 58 | <para>Create a separate build directory for libstdc++ and enter it:</para>
|
---|
| 59 |
|
---|
| 60 | <screen><userinput remap="pre">mkdir -v build
|
---|
| 61 | cd build</userinput></screen>
|
---|
| 62 |
|
---|
| 63 | <para>Prepare libstdc++ for compilation:</para>
|
---|
| 64 |
|
---|
[d7e0db5] | 65 | <screen arch="default"><userinput remap="configure">../libstdc++-v3/configure \
|
---|
[51b58ad] | 66 | CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
|
---|
| 67 | --prefix=/usr \
|
---|
| 68 | --disable-multilib \
|
---|
| 69 | --disable-nls \
|
---|
| 70 | --host=$(uname -m)-lfs-linux-gnu \
|
---|
| 71 | --disable-libstdcxx-pch</userinput></screen>
|
---|
| 72 | <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../libstdc++-v3/configure \
|
---|
| 73 | CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
|
---|
| 74 | --prefix=/usr \
|
---|
| 75 | --enable-multilib \
|
---|
| 76 | --disable-nls \
|
---|
| 77 | --host=$(uname -m)-lfs-linux-gnu \
|
---|
[6dfcfecc] | 78 | --disable-libstdcxx-pch</userinput></screen>
|
---|
| 79 |
|
---|
| 80 | <variablelist>
|
---|
| 81 | <title>The meaning of the configure options:</title>
|
---|
| 82 |
|
---|
| 83 | <varlistentry>
|
---|
| 84 | <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term>
|
---|
| 85 | <listitem>
|
---|
| 86 | <para>These flags are passed by the top level Makefile when doing
|
---|
| 87 | a full build of GCC.</para>
|
---|
| 88 | </listitem>
|
---|
| 89 | </varlistentry>
|
---|
| 90 |
|
---|
[51b58ad] | 91 | <varlistentry>
|
---|
| 92 | <term><parameter>--host=$(uname -m)-lfs-linux-gnu</parameter></term>
|
---|
| 93 | <listitem>
|
---|
| 94 | <para>We have to mimic what would happen if this package were built
|
---|
| 95 | as part of a full compiler build. This switch would be passed to
|
---|
| 96 | configure by GCC's build machinery.</para>
|
---|
| 97 | </listitem>
|
---|
| 98 | </varlistentry>
|
---|
| 99 |
|
---|
[6dfcfecc] | 100 | <varlistentry>
|
---|
| 101 | <term><parameter>--disable-libstdcxx-pch</parameter></term>
|
---|
| 102 | <listitem>
|
---|
| 103 | <para>This switch prevents the installation of precompiled
|
---|
| 104 | include files, which are not needed at this stage.</para>
|
---|
| 105 | </listitem>
|
---|
| 106 | </varlistentry>
|
---|
| 107 |
|
---|
| 108 | <varlistentry arch="ml_32,ml_x32,ml_all">
|
---|
| 109 | <term><parameter>--enable-multilib</parameter></term>
|
---|
| 110 | <listitem>
|
---|
| 111 | <para>This switch is set by default but it is added here
|
---|
| 112 | explicitly for documentary purpose. The libstdc++ libraries
|
---|
| 113 | will be built for every arch (m64, m32, mx32) which are
|
---|
| 114 | made available in <xref linkend="ch-tools-gcc-pass1"/>.</para>
|
---|
| 115 | </listitem>
|
---|
| 116 | </varlistentry>
|
---|
| 117 |
|
---|
| 118 | </variablelist>
|
---|
| 119 |
|
---|
| 120 | <para>Compile libstdc++ by running:</para>
|
---|
| 121 |
|
---|
| 122 | <screen><userinput remap="make">make</userinput></screen>
|
---|
| 123 |
|
---|
| 124 | <para>Install the library:</para>
|
---|
| 125 |
|
---|
| 126 | <screen><userinput remap="install">make install</userinput></screen>
|
---|
| 127 |
|
---|
| 128 | </sect2>
|
---|
| 129 |
|
---|
| 130 | <sect2 role="content">
|
---|
| 131 | <title/>
|
---|
| 132 |
|
---|
| 133 | <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para>
|
---|
| 134 |
|
---|
| 135 | </sect2>
|
---|
| 136 |
|
---|
| 137 | </sect1>
|
---|