libstdc++-pass2.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. --host=$(uname -m)-lfs-linux-gnu \
  54. --disable-libstdcxx-pch</userinput></screen>
  55. <variablelist>
  56. <title>The meaning of the configure options:</title>
  57. <varlistentry>
  58. <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term>
  59. <listitem>
  60. <para>These flags are passed by the top level Makefile when doing
  61. a full build of GCC.</para>
  62. </listitem>
  63. </varlistentry>
  64. <varlistentry>
  65. <term><parameter>--host=$(uname -m)-lfs-linux-gnu</parameter></term>
  66. <listitem>
  67. <para>We have to mimic what would happen if this package were built
  68. as part of a full compiler build. This switch would be passed to
  69. configure by GCC's build machinery.</para>
  70. </listitem>
  71. </varlistentry>
  72. <varlistentry>
  73. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  74. <listitem>
  75. <para>This switch prevents the installation of precompiled
  76. include files, which are not needed at this stage.</para>
  77. </listitem>
  78. </varlistentry>
  79. </variablelist>
  80. <para>Compile libstdc++ by running:</para>
  81. <screen><userinput remap="make">make</userinput></screen>
  82. <para>Install the library:</para>
  83. <screen><userinput remap="install">make install</userinput></screen>
  84. </sect2>
  85. <sect2 role="content">
  86. <title/>
  87. <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para>
  88. </sect2>
  89. </sect1>