这个包的详细信息位于 第 6.17.2 节 “GCC 的内容.”
Libstdc++ 是标准 C++ 库。g++ 编译器需要它来进行正确的操作。
Libstdc++ 是 GCC 源文件中的一部分。你应该先解包
GCC,然后切换到 gcc-4.8.2
目录。
为 Libstdc++ 创建一个目录,然后进入它:
mkdir -pv ../gcc-build cd ../gcc-build
准备编译 Libstdc++:
../gcc-4.8.2/libstdc++-v3/configure \ --host=$LFS_TGT \ --prefix=/tools \ --disable-multilib \ --disable-shared \ --disable-nls \ --disable-libstdcxx-threads \ --disable-libstdcxx-pch \ --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/4.8.2
配置选项的含义:
--host=...
使用我们刚构建的交叉编译器,而不是用 /usr/bin
里的。
--disable-libstdcxx-threads
由于我们没有构建线程 C 库,线程 C++ 库也就不能被构建。
--disable-libstdcxx-pch
这个选项防止安装预编译的 include 文件,目前不需要它们。
--with-gxx-include-dir=/tools/include/c++/4.8.2
这是 C++ 编译器查找标准 include 文件的位置。在普通的构建中,这个信息从顶级目录传送给 Libstdc++ 的 configure 选项。而在我们的情况下,这个信息必须明确地给出。
编译 libstdc++,运行:
make
安装库:
make install
这个包的详细信息位于 第 6.17.2 节 “GCC 的内容.”