Cross-compiling with Cmake doesn't set rpath correctly -
i trying cross-compile cmake project raspberry pi. when builds following error:
/home/me/dev/raspberry_pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: libz.so.1, needed /home/me/dev/raspberry_pi/rootfs/usr/lib/arm-linux-gnueabihf/libssl.so, not found (try using -rpath or -rpath-link)
the desired library in /home/me/dev/raspberry_pi/rootfs/lib/arm-linux-gnueabihf.
the link.txt executable is:
/home/me/dev/raspberry_pi/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc cmakefiles/gp_daemon.dir/src/client_manager.c.o cmakefiles/gp_daemon.dir/src/common_crypto.c.o cmakefiles/gp_daemon.dir/src/config_manager.c.o cmakefiles/gp_daemon.dir/src/db_manager.c.o cmakefiles/gp_daemon.dir/src/main.c.o cmakefiles/gp_daemon.dir/src/peer_manager.c.o cmakefiles/gp_daemon.dir/src/server_manager.c.o cmakefiles/gp_daemon.dir/src/message.c.o -o gp_daemon ../vendors/enet/libvendorenetstatic.a ../vendors/sqlite3/libvendorsqlite3static.a /home/me/dev/raspberry_pi/rootfs/usr/lib/arm-linux-gnueabihf/libssl.so /home/me/dev/raspberry_pi/rootfs/usr/lib/arm-linux-gnueabihf/libcrypto.so -ldl /home/me/dev/raspberry_pi/rootfs/usr/lib/arm-linux-gnueabihf/libdl.so -pthread -wl,-rpath,/home/me/dev/raspberry_pi/rootfs/usr/lib/arm-linux-gnueabihf
as can see there -rpath option linker, wrong has "usr" in it. how add 1 without "usr" part?
i have tried setting following in toolchain configuration file:
set(cmake_c_flags "${cmake_c_flags} -wl,-rpath,${cmake_find_root_path}/lib/arm-linux-gnueabihf") set(cmake_cxx_flags "${cmake_cxx_flags} -wl,-rpath,${cmake_find_root_path}/lib/arm-linux-gnueabihf") set(cmake_exe_linker_flags "${cmake_exe_linker_flags} -rpath ${cmake_find_root_path}/lib/arm-linux-gnueabihf")
Comments
Post a Comment