Discussion:
ld doesn't respect -L faithfully under sb2 2.2.3
Haohui Mai
2011-06-26 21:38:13 UTC
Permalink
Hi folks,

I got a problem when I'm trying to building Qt under sb2 2.2.3.

The program requires X11.so, which requires libxcb.so.1 itself. however, it seems that ld didn't try to find the file under the directory specified by "-L", which causing the problem.

sb2 g++ -Wl,-O1 -Wl,-rpath,/home/foo/work/peregrine/dist/lib -o xlib xlib.o -L/usr/lib/arm-linux-gnueabi -lXext -lX11 -lm
/home/foo/work/peregrine/utils/sb2/toolchain/arm-2010q1/bin/arm-none-linux-gnueabi-ld: warning: libxcb.so.1, needed by /usr/lib/arm-linux-gnueabi/libX11.so, not found (try using -rpath or -rpath-link)
/usr/lib/arm-linux-gnueabi/libX11.so: undefined reference to `xcb_connection_has_error'
...

Here are the log from sb2-logz:

***@commando:~/work/peregrine/build/qt-build/config.tests/x11/xlib$ sb2-logz -p < /home/foo/sb2_logs/g++.20110626-1634.6036.log|grep "xcb"
2 /home/foo/work/peregrine/dist/lib/libxcb.so.1
2 /home/foo/work/peregrine/utils/sb2/toolchain/arm-2011.03/arm-none-linux-gnueabi/libc/lib/libxcb.so.1
2 /home/foo/work/peregrine/utils/sb2/toolchain/arm-2011.03/arm-none-linux-gnueabi/libc/usr/lib/libxcb.so.1
2 /home/foo/work/peregrine/utils/sb2/toolchain/arm-2011.03/arm-none-linux-gnueabi/libc/usr/local/lib/libxcb.so.1
2 <TARGET_ROOT>/lib/libxcb.so.1
2 <TARGET_ROOT>/usr/lib/libxcb.so.1

***@commando:~/work/peregrine/build/qt-build/config.tests/x11/xlib$ sb2-logz -m < /home/foo/sb2_logs/g++.20110626-1634.6036.log|grep "xcb"
<empty>

I'm not sure whether this is a problem with sb2, or it's a problem of ld itself. I'm using the newest version CodeSourcery toolchain.

I appreciate your help.

Thanks
~Haohui

Loading...