From 1907b76c4f9b844bfeb8108c4d3886c62413c1ab Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 2 Oct 2019 17:01:12 +0200 Subject: [PATCH] gdb: Rebuild gdb produces a warning messages on startup: buczek@sigusr2:~$ gdb Traceback (most recent call last): File "/usr/share/gdb/python/gdb/__init__.py", line 143, in auto_load_packages __import__(modname) File "/usr/share/gdb/python/gdb/command/frame_filters.py", line 21, in import copy File "/usr/local/system/python-2.7.16-0/lib/python2.7/copy.py", line 52, in import weakref File "/usr/local/system/python-2.7.16-0/lib/python2.7/weakref.py", line 14, in from _weakref import ( ImportError: cannot import name _remove_dead_weakref This seems to be related to an incompatibility between the include files from python 2.7.16 from /usr/local/system/python2 and /usr/lib/libpython2.7.so from python2_compat which is based on python 2.7.11. Add -L to use correct library at link time. Add -Wl,-rpath= to use correct library at run time. --- gdb.be0 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb.be0 b/gdb.be0 index e4a497a98..ad7bb3726 100755 --- a/gdb.be0 +++ b/gdb.be0 @@ -1,6 +1,6 @@ #!/usr/bin/env beesh -# BEE_VERSION gdb-8.3.1-0 +# BEE_VERSION gdb-8.3.1-1 SRCURL[0]="http://ftp.gnu.org/gnu/gdb/gdb-${PKGVERSION}.tar.xz" @@ -20,7 +20,9 @@ SRCURL[0]="http://ftp.gnu.org/gnu/gdb/gdb-${PKGVERSION}.tar.xz" #} mee_configure() { - bee_configure --with-python=/usr/local/system/python2 + bee_configure --with-python=/usr/local/system/python2 \ + CFLAGS="-L/usr/local/system/python2/lib -Wl,-rpath=/usr/local/system/python2/lib" \ + CXXFLAGS="-L/usr/local/system/python2/lib -Wl,-rpath=/usr/local/system/python2/lib" } #mee_build() {