我正在尝试从源代码构建最新的 gdb 10.1。
[我想要这样做的原因是我正在尝试调试一个链接到 Python 2.7.18 的自定义构建的程序,并且我的系统 gdb 链接到我的 /lib64 目录中的 Python 2.7.5 的构建,并且不适用于较新版本]。
阅读完 README 文件后,我使用以下方式进行了配置:
../gdb-10.1/configure --with-python=<path to my 2.7.18 installation> --prefix=<path to where I want the new gdb to go>
...然后运行
make all install
...按照说明。但是,每次构建尝试都会以以下形式的大量错误消息失败:
python/py-arch.o: In function `gdbarch_to_arch_object(gdbarch*)':
.../build/gdb/../../../gdb-10.1/gdb/python/py-arch.c:86: undefined reference to `_Py_RefTotal'
python/py-arch.o: In function `gdbpy_ref_policy<_object>::decref(_object*)':
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_RefTotal'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_Dealloc'
.../build/gdb/../../../gdb-10.1/gdb/python/py-ref.h:36: undefined reference to `_Py_NegativeRefcount'
在检查配置步骤的输出和 Makefile 本身时,我根本找不到对我在配置时指定的 Python 安装的任何引用(并且我还把它放在我的 LD_LIBRARY_PATH 的头部以确保编译器并且链接器可以在构建时找到它)。
我在这里想念什么?