5.8. Libstdc++ from GCC-9.2.0

Libstdc++ is the standard C++ library. It is needed to compile C++ code (part of GCC is written in C++), but we had to defer its installation when we built gcc-pass1 because it depends on glibc, which was not yet available in /tools.

Temps de construction approximatif: 0.5 SBU
Espace disque requis: 878 Mo

5.8.1. Installation de Libstdc++ Cible

[Note]

Note

Libstdc++ fait partie des sources de GCC. Vous devriez d'abord déballer l'archive tar de GCC et vous rendre dans le répertoire gcc-9.2.0.

Create a separate build directory for Libstdc++ and enter it:

mkdir -v build
cd build

Prepare Libstdc++ for compilation:

../libstdc++-v3/configure           \
    --host=$LFS_TGT                 \
    --prefix=/tools                 \
    --disable-multilib              \
    --disable-nls                   \
    --disable-libstdcxx-threads     \
    --disable-libstdcxx-pch         \
    --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/9.2.0

Voici la signification des options de configure :

--host=...

Indicates to use the cross compiler we have just built instead of the one in /usr/bin.

--disable-libstdcxx-threads

Comme gcc-pass1 est construit sans la prise en charge des thread, la bibliothèque thread de C++ ne peut pas non plus être construite.

--disable-libstdcxx-pch

Ce paramètre empêche l'installation des fichiers inclus pré-compilés, qui ne sont pas nécessaires pour l'instant.

--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/9.2.0

This is the location where the standard include files are searched by the C++ compiler. In a normal build, this information is automatically passed to the Libstdc++ configure options from the top level directory. In our case, this information must be explicitly given.

Compilez libstdc++ en lançant :

make

Installez la bibliothèque :

make install

Les détails sur ce paquet sont situés dans Section 6.25.2, « Contenu de GCC. »