Search code examples
gdbqnx

gdb requires libpthread in QNX


So I am having a serious issue where the qnx version of gdb downloaded from foundry27 (the qnx software site) requires libpthread.so.1 :

qnx:/root/# gdb 
ldd:FATAL: Could not load library libpthread.so.1

Now this is intriguing to me because according to here and my own past experience there is no pthread shared lib in QNX, the pthread content is part of libc.

I know this is a long shot but has anyone encountered this before?

EDIT:

qnx:/root/# uname -a
QNX qnx 6.5.0 2010/07/09-14:44:03EDT x86pc x86

I tried downloading qnx from here: http://community.qnx.com/sf/frs/do/viewRelease/projects.toolchain/frs.gdb.gdb_7_6_r863

I got the nto-gdb version because the options are as follows:

gdb-prereq-linux.tgz
gdb-prereq-win32.tgz
linux-gdb-7.6.tar.gz
win32-gdb-7.6.zip
nto-arm-gdb-7.6.tar.gz
nto-gdb-7.6.tar.gz

GDB info

ls -l $(which -a gdb)
lrwxrwxrwx  1 501   501 10 Jul 09 14:21 /usr/qnx650/host/qnx6/x86/usr/bin/gdb -> ntox86-gdb

GDB debug info

libs: load_object: attempt load of libpthread.so.1
debug: find_file:1151: name=libpthread.so.1 libpath=:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/ACE_wrappers/lib:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/DDS/lib:/usr/local/lib rpath=/usr/pkg/lib
debug: searchpath:1095: name=libpthread.so.1 path=/usr/pkg/lib amode=4 bufsize=1025
debug: searchpath:1119: trying /usr/pkg/lib/libpthread.so.1
debug: searchpath:1130:/usr/pkg/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1095: name=libpthread.so.1 path=:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/ACE_wrappers/lib:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/DDS/lib:/usr/local/lib amode=4 bufsize=1025
debug: searchpath:1119: trying libpthread.so.1
debug: searchpath:1130:libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/ACE_wrappers/lib/libpthread.so.1
debug: searchpath:1130:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/ACE_wrappers/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/DDS/lib/libpthread.so.1
debug: searchpath:1130:/root/SMG/extern/libs/opendds/OpenDDS_ACE_TAO/DDS/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /usr/local/lib/libpthread.so.1
debug: searchpath:1130:/usr/local/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1095: name=libpthread.so.1 path=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib amode=4 bufsize=1025
debug: searchpath:1119: trying /proc/boot/libpthread.so.1
debug: searchpath:1130:/proc/boot/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /lib/libpthread.so.1
debug: searchpath:1130:/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /usr/lib/libpthread.so.1
debug: searchpath:1130:/usr/lib/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /lib/dll/libpthread.so.1
debug: searchpath:1130:/lib/dll/libpthread.so.1: failed (No such file or directory)
debug: searchpath:1119: trying /opt/lib/libpthread.so.1
debug: searchpath:1130:/opt/lib/libpthread.so.1: failed (No such file or directory)
debug: ldd:find_file:1175:libpthread.so.1: search failed
ldd:FATAL: Could not load library libpthread.so.1

Solution

  • The reason for this is that the GDB executables provided on foundry 27 (the later ones) are built for QNX 6.6 which is cross compiled and deployed to a system rather than natively compiled. As in there is no native development and therefore the GDB executable wont work on QNX 6.5.

    To solve this download a earlier version of the GDB executable.