libstdc++-pass2.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 arch="default"><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. <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../libstdc++-v3/configure \
  55. CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
  56. --prefix=/usr \
  57. --enable-multilib \
  58. --disable-nls \
  59. --disable-libstdcxx-pch \
  60. --host=x86_64-lfs-linux-gnu</userinput></screen>
  61. <variablelist>
  62. <title>The meaning of the configure options:</title>
  63. <varlistentry>
  64. <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term>
  65. <listitem>
  66. <para>These flags are passed by the top level Makefile when doing
  67. a full build of GCC.</para>
  68. </listitem>
  69. </varlistentry>
  70. <varlistentry>
  71. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  72. <listitem>
  73. <para>This switch prevents the installation of precompiled
  74. include files, which are not needed at this stage.</para>
  75. </listitem>
  76. </varlistentry>
  77. <varlistentry arch="ml_32,ml_x32,ml_all">
  78. <term><parameter>--enable-multilib</parameter></term>
  79. <listitem>
  80. <para>This switch is set by default but it is added here
  81. explicitly for documentary purpose. The libstdc++ libraries
  82. will be built for every arch (m64, m32, mx32) which are
  83. made available in <xref linkend="ch-tools-gcc-pass1"/>.</para>
  84. </listitem>
  85. </varlistentry>
  86. <varlistentry arch="ml_32,ml_x32,ml_all">
  87. <term><parameter>--host=x86_64-pc-linux-gnu</parameter></term>
  88. <listitem>
  89. <para>Since up to now the cross-compile tools are used. This
  90. switch is set to ensure that the headers used for multilib are
  91. placed in correct locations where the final system can pick
  92. them up.</para>
  93. </listitem>
  94. </varlistentry>
  95. </variablelist>
  96. <para>Compile libstdc++ by running:</para>
  97. <screen><userinput remap="make">make</userinput></screen>
  98. <para>Install the library:</para>
  99. <screen><userinput remap="install">make install</userinput></screen>
  100. </sect2>
  101. <sect2 role="content">
  102. <title/>
  103. <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para>
  104. </sect2>
  105. </sect1>