libstdc++.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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-pass1" role="wrap">
  8. <?dbhtml filename="gcc-libstdc++-pass1.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 1</title>
  15. <indexterm zone="ch-tools-libstdcpp-pass1">
  16. <primary sortas="a-GCC">GCC</primary>
  17. <secondary>tools, libstdc++ pass 1</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <para>Libstdc++ is the standard C++ library. It is needed
  22. to compile C++ code
  23. (part of GCC is written in C++), but we had to defer its installation
  24. when we built <xref linkend="ch-tools-gcc-pass1"/>
  25. because it depends on glibc, which was not yet available in the target
  26. directory.
  27. </para>
  28. <segmentedlist>
  29. <segtitle>&buildtime;</segtitle>
  30. <segtitle>&diskspace;</segtitle>
  31. <seglistitem>
  32. <seg>&libstdcpp-tmpp1-sbu;</seg>
  33. <seg>&libstdcpp-tmpp1-du;</seg>
  34. </seglistitem>
  35. </segmentedlist>
  36. </sect2>
  37. <sect2 role="installation">
  38. <title>Installation of Target Libstdc++</title>
  39. <note>
  40. <para><application>Libstdc++</application> is part of the GCC sources.
  41. You should first unpack the GCC tarball and change to the
  42. <filename>gcc-&gcc-version;</filename> directory.</para>
  43. </note>
  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. --host=$LFS_TGT \
  50. --build=$(../config.guess) \
  51. --prefix=/usr \
  52. --disable-multilib \
  53. --disable-nls \
  54. --disable-libstdcxx-pch \
  55. --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
  56. <variablelist>
  57. <title>The meaning of the configure options:</title>
  58. <varlistentry>
  59. <term><parameter>--host=...</parameter></term>
  60. <listitem>
  61. <para>Specifies that the cross compiler we have just built
  62. should be used instead of the one in
  63. <filename>/usr/bin</filename>.</para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry arch="ml_32,ml_x32,ml_all">
  67. <term><parameter>--disable-multilib</parameter></term>
  68. <listitem>
  69. <para>Even when building the multilib version, this switch is
  70. given. This is because the additionally built libraries are
  71. not required in this stage and some disk space and compile
  72. time can be saved.</para>
  73. </listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  77. <listitem>
  78. <para>This switch prevents the installation of precompiled
  79. include files, which are not needed at this stage.</para>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry>
  83. <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
  84. <listitem>
  85. <para>This is the location where the C++ compiler should search for the
  86. standard include files. In a normal build, this information
  87. is automatically passed to the libstdc++ <command>configure</command>
  88. options from the top level directory. In our case, this information
  89. must be explicitly given.</para>
  90. </listitem>
  91. </varlistentry>
  92. </variablelist>
  93. <para>Compile libstdc++ by running:</para>
  94. <screen><userinput remap="make">make</userinput></screen>
  95. <para>Install the library:</para>
  96. <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
  97. </sect2>
  98. <sect2 role="content">
  99. <title/>
  100. <para>Details on this package are located in
  101. <xref linkend="contents-gcc" role="."/></para>
  102. </sect2>
  103. </sect1>