I get the following error when cross compiling my program:
opened script file /home/ugo/dev/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libpthread.so
opened script file /home/ugo/dev/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libpthread.so
attempt to open /lib/arm-linux-gnueabihf/libpthread.so.0 failed
attempt to open /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a failed
/home/ugo/dev/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
/home/ugo/dev/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
Part of cmake Toolchain:
SET(CMAKE_FIND_ROOT_PATH $ENV{ROOTFS_DIR} $ENV{CROSSROOT_DIR})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp --sysroot=$ENV{ROOTFS_DIR}" CACHE STRING "cache it")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=$ENV{ROOTFS_DIR}" CACHE STRING "cache it")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=$ENV{ROOTFS_DIR}" CACHE STRING "cache it")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --sysroot=$ENV{ROOTFS_DIR}" CACHE STRING "cache it")
ld cannot find pthread even though the library seems to correctly match the location in sysroot.
i.e. $ENV{ROOTFS_DIR}/lib/arm-linux-gnueabihf/libpthread.so.0 exists
The solution given in the following links is to remove the relative paths from pthread (and libc) linker scripts (tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libpthread.so):
http://go-robot.blogspot.fr/2014_09_01_archive.html
http://linux.bytesex.org/cross-compiler.html
http://www.mira-project.org/MIRA-doc/CrossCompilePage.html
...
It fixed my problem. Does it make sense to send a pull request removing this absolute path on the repository ?
I get the following error when cross compiling my program:
Part of cmake Toolchain:
ld cannot find pthread even though the library seems to correctly match the location in sysroot.
i.e. $ENV{ROOTFS_DIR}/lib/arm-linux-gnueabihf/libpthread.so.0 exists
The solution given in the following links is to remove the relative paths from pthread (and libc) linker scripts (tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libpthread.so):
http://go-robot.blogspot.fr/2014_09_01_archive.html
http://linux.bytesex.org/cross-compiler.html
http://www.mira-project.org/MIRA-doc/CrossCompilePage.html
...
It fixed my problem. Does it make sense to send a pull request removing this absolute path on the repository ?