I have setup a development platform based on Ubuntu 12.04 to cross-compile some of my applications for Raspberry Pi using Raspbian.
I used Debootstrap to get a Raspbian environment on my hostsystem. Now I can chroot with Qemu into this environment and install needed development libraries (with apt-get).
Also I downloaded the toolchain provided via Github. I set the Include-Path to /home/phate/rpi/chroot-raspbian-armhf/usr/include and the Libaray search path to /home/phate/rpi/chroot-raspbian-armhf/usr/lib. I can compile most of my applications using this setup which are also using pthread.
But one of my applications is using a library that gets installed to /usr/lib/arm-linux-gnueabihf which is /home/phate/rpi/chroot-raspbian-armhf/usr/lib/arm-linux-gnueabihf on my hostsystem. So I added this path to the library search paths. The linker can now find these libraries. But in /home/phate/rpi/chroot-raspbian-armhf/usr/lib/arm-linux-gnueabihf is also lying libpthread. Which causes the linker to fail with this error:
It seems the linker is searching on the hostsystem for this file: /lib/arm-linux-gnueabihf/libpthread.so.0, which is of course not available. I'm using pthread with other applications that do not use this libaray search path and it's working fine. Does somebody have tip for me? I ran out of ideas.
Code: Select all
/home/phate/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0 /home/phate/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a collect2: error: ld returned 1 exit status