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">
8 <sect1 id="ch-tools-libstdcpp-pass2" role="wrap">
9 <?dbhtml filename="gcc-libstdc++-pass2.html"?>
11 <sect1info condition="script">
12 <productname>gcc-libstdc++</productname>
13 <productnumber>&gcc-version;</productnumber>
14 <address>&gcc-url;</address>
17 <title>Libstdc++ from GCC-&gcc-version;, Pass 2</title>
19 <indexterm zone="ch-tools-libstdcpp-pass2">
20 <primary sortas="a-GCC">GCC</primary>
21 <secondary>tools, libstdc++ pass 2</secondary>
24 <sect2 role="package">
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>
34 <segtitle>&buildtime;</segtitle>
35 <segtitle>&diskspace;</segtitle>
38 <seg>&libstdcpp-tmpp2-sbu;</seg>
39 <seg>&libstdcpp-tmpp2-du;</seg>
45 <sect2 role="installation">
46 <title>Installation of Target Libstdc++</title>
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>
54 <para>Create a link which exists when building libstdc++ in the gcc tree:</para>
56 <screen><userinput remap="pre">ln -s gthr-posix.h libgcc/gthr-default.h</userinput></screen>
58 <para>Create a separate build directory for libstdc++ and enter it:</para>
60 <screen><userinput remap="pre">mkdir -v build
61 cd build</userinput></screen>
63 <para>Prepare libstdc++ for compilation:</para>
65 <screen><userinput remap="configure">../libstdc++-v3/configure \
66 CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
70 --disable-libstdcxx-pch</userinput></screen>
73 <title>The meaning of the configure options:</title>
76 <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term>
78 <para>These flags are passed by the top level Makefile when doing
79 a full build of GCC.</para>
84 <term><parameter>--disable-libstdcxx-pch</parameter></term>
86 <para>This switch prevents the installation of precompiled
87 include files, which are not needed at this stage.</para>
93 <para>Compile libstdc++ by running:</para>
95 <screen><userinput remap="make">make</userinput></screen>
97 <para>Install the library:</para>
99 <screen><userinput remap="install">make install</userinput></screen>
103 <sect2 role="content">
106 <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para>