libstdc++-pass2.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <sect1 id="ch-tools-libstdcpp-pass2" role="wrap">
  8. <?dbhtml filename="gcc-libstdc++-pass2.html"?>
  9. <sect1info condition="script">
  10. <productname>gcc-libstdc++</productname>
  11. <productnumber>&gcc-version;</productnumber>
  12. <address>&gcc-url;</address>
  13. </sect1info>
  14. <title>Libstdc++ from GCC-&gcc-version;, Pass 2</title>
  15. <indexterm zone="ch-tools-libstdcpp-pass2">
  16. <primary sortas="a-GCC">GCC</primary>
  17. <secondary>tools, libstdc++ pass 2</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <para>When building <xref linkend="ch-tools-gcc-pass2"/> we had to defer
  22. the installation of the C++ standard library because no suitable compiler
  23. was available to compile it. We could not use the compiler built in that
  24. section because it is a native compiler and should not be used outside of
  25. chroot and risks polluting the libraries with some host components.</para>
  26. <segmentedlist>
  27. <segtitle>&buildtime;</segtitle>
  28. <segtitle>&diskspace;</segtitle>
  29. <seglistitem>
  30. <seg>&libstdcpp-tmpp2-sbu;</seg>
  31. <seg>&libstdcpp-tmpp2-du;</seg>
  32. </seglistitem>
  33. </segmentedlist>
  34. </sect2>
  35. <sect2 role="installation">
  36. <title>Installation of Target Libstdc++</title>
  37. <note>
  38. <para><application>Libstdc++</application> is part of the GCC sources.
  39. You should first unpack the GCC tarball and change to the
  40. <filename>gcc-&gcc-version;</filename> directory.</para>
  41. </note>
  42. <para>Create a link which exists when building libstdc++ in the gcc tree:</para>
  43. <screen><userinput remap="pre">ln -s gthr-posix.h libgcc/gthr-default.h</userinput></screen>
  44. <para>Create a separate build directory for libstdc++ and enter it:</para>
  45. <screen><userinput remap="pre">mkdir -v build
  46. cd build</userinput></screen>
  47. <para>Prepare libstdc++ for compilation:</para>
  48. <screen><userinput remap="configure">../libstdc++-v3/configure \
  49. CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
  50. --prefix=/usr \
  51. --disable-multilib \
  52. --disable-nls \
  53. --disable-libstdcxx-pch</userinput></screen>
  54. <variablelist>
  55. <title>The meaning of the configure options:</title>
  56. <varlistentry>
  57. <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term>
  58. <listitem>
  59. <para>These flags are passed by the top level Makefile when doing
  60. a full build of GCC.</para>
  61. </listitem>
  62. </varlistentry>
  63. <varlistentry>
  64. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  65. <listitem>
  66. <para>This switch prevents the installation of precompiled
  67. include files, which are not needed at this stage.</para>
  68. </listitem>
  69. </varlistentry>
  70. </variablelist>
  71. <para>Compile libstdc++ by running:</para>
  72. <screen><userinput remap="make">make</userinput></screen>
  73. <para>Install the library:</para>
  74. <screen><userinput remap="install">make install</userinput></screen>
  75. </sect2>
  76. <sect2 role="content">
  77. <title/>
  78. <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para>
  79. </sect2>
  80. </sect1>