我试图用调试标志从源代码中构建gcc版本10.00.1,以使一些函数(如STL中的方法)能够在GDB中打印。现在GDB会说“无法找到方法std::stringstream::str”这样的话,即使在编译我的程序时我有-g3标志。
gcc的文档要求使用--enable-libstdcxx-debug标志来配置应用程序,以便能够启用这种支持。我决定使用与gcc配置的发行版相同的标志构建应用程序,这些标志是
-v --with-pkgversion='Debian 9.2.1-28' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
在一个成功的make和make install之后,我仍然面临着同样的问题,GDB找不到方法。我决定自己构建libstdc++,只使用--enable-libstdc++-debug标志。但是我找不到构建中任何地方的libstdc++.so.6文件。我还没有运行make install,因为我不想破坏我的系统。libstdc++.so.6应该位于构建中的哪个位置?谢谢
发布于 2020-02-19 10:27:06
我还没有运行
make install,因为我不想破坏我的系统。
使用--prefix选项configure可以指定另一个安装位置,以避免替换系统gcc。
--我决定自己构建
libstdc++,只使用--enable-libstdc++-debug标志。
确保在重新编译make clean后使用configure,以便make用新的编译器和链接器标志重新构建它。
https://stackoverflow.com/questions/60295570
复制相似问题