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" role="wrap">
|
---|
9 | <?dbhtml filename="gcc-libstdc++.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;</title>
|
---|
18 |
|
---|
19 | <indexterm zone="ch-tools-libstdcpp">
|
---|
20 | <primary sortas="a-GCC">GCC</primary>
|
---|
21 | <secondary>tools, libstdc++ pass 1</secondary>
|
---|
22 | </indexterm>
|
---|
23 |
|
---|
24 | <sect2 role="package">
|
---|
25 | <title/>
|
---|
26 |
|
---|
27 | <para>Libstdc++ is the standard C++ library. It is needed
|
---|
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"/>
|
---|
31 | because Libstdc++ depends on Glibc, which was not yet available in the target
|
---|
32 | directory.
|
---|
33 | </para>
|
---|
34 |
|
---|
35 | <segmentedlist>
|
---|
36 | <segtitle>&buildtime;</segtitle>
|
---|
37 | <segtitle>&diskspace;</segtitle>
|
---|
38 |
|
---|
39 | <seglistitem>
|
---|
40 | <seg>&libstdcpp-tmpp1-sbu;</seg>
|
---|
41 | <seg>&libstdcpp-tmpp1-du;</seg>
|
---|
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 |
|
---|
56 | <para>Create a separate build directory for Libstdc++ and enter it:</para>
|
---|
57 |
|
---|
58 | <screen><userinput remap="pre">mkdir -v build
|
---|
59 | cd build</userinput></screen>
|
---|
60 |
|
---|
61 | <para>Prepare Libstdc++ for compilation:</para>
|
---|
62 |
|
---|
63 | <screen><userinput remap="configure">../libstdc++-v3/configure \
|
---|
64 | --host=$LFS_TGT \
|
---|
65 | --build=$(../config.guess) \
|
---|
66 | --prefix=/usr \
|
---|
67 | --disable-multilib \
|
---|
68 | --disable-nls \
|
---|
69 | --disable-libstdcxx-pch \
|
---|
70 | --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
|
---|
71 |
|
---|
72 | <variablelist>
|
---|
73 | <title>The meaning of the configure options:</title>
|
---|
74 |
|
---|
75 | <varlistentry>
|
---|
76 | <term><parameter>--host=...</parameter></term>
|
---|
77 | <listitem>
|
---|
78 | <para>Specifies that the cross-compiler we have just built
|
---|
79 | should be used instead of the one in
|
---|
80 | <filename>/usr/bin</filename>.</para>
|
---|
81 | </listitem>
|
---|
82 | </varlistentry>
|
---|
83 |
|
---|
84 | <varlistentry>
|
---|
85 | <term><parameter>--disable-libstdcxx-pch</parameter></term>
|
---|
86 | <listitem>
|
---|
87 | <para>This switch prevents the installation of precompiled
|
---|
88 | include files, which are not needed at this stage.</para>
|
---|
89 | </listitem>
|
---|
90 | </varlistentry>
|
---|
91 |
|
---|
92 | <varlistentry>
|
---|
93 | <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
|
---|
94 | <listitem>
|
---|
95 | <para>This specifies the installation directory for include files.
|
---|
96 | Because Libstdc++ is the standard C++ library for LFS, this
|
---|
97 | directory should match the location where the C++ compiler
|
---|
98 | (<command>$LFS_TGT-g++</command>) would search for the
|
---|
99 | standard C++ include files. In a normal build, this information
|
---|
100 | is automatically passed to the Libstdc++ <command>configure</command>
|
---|
101 | options from the top level directory. In our case, this information
|
---|
102 | must be explicitly given.
|
---|
103 | The C++ compiler will prepend the sysroot path
|
---|
104 | <filename class="directory">$LFS</filename> (specified when building
|
---|
105 | GCC-pass1) to the include file search path, so it will actually
|
---|
106 | search in
|
---|
107 | <filename class="directory">$LFS/tools/$LFS_TGT/include/c++/&gcc-version;</filename>.
|
---|
108 | The combination of the <parameter>DESTDIR</parameter>
|
---|
109 | variable (in the <command>make install</command> command below)
|
---|
110 | and this switch causes the headers to be installed there.</para>
|
---|
111 | </listitem>
|
---|
112 | </varlistentry>
|
---|
113 |
|
---|
114 | </variablelist>
|
---|
115 |
|
---|
116 | <para>Compile Libstdc++ by running:</para>
|
---|
117 |
|
---|
118 | <screen><userinput remap="make">make</userinput></screen>
|
---|
119 |
|
---|
120 | <para>Install the library:</para>
|
---|
121 |
|
---|
122 | <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
|
---|
123 |
|
---|
124 | <para>Remove the libtool archive files because they are harmful for
|
---|
125 | cross-compilation:</para>
|
---|
126 |
|
---|
127 | <screen><userinput remap="install">rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la</userinput></screen>
|
---|
128 |
|
---|
129 | </sect2>
|
---|
130 |
|
---|
131 | <sect2 role="content">
|
---|
132 | <title/>
|
---|
133 |
|
---|
134 | <para>Details on this package are located in
|
---|
135 | <xref linkend="contents-gcc" role="."/></para>
|
---|
136 |
|
---|
137 | </sect2>
|
---|
138 |
|
---|
139 | </sect1>
|
---|