Cross compilation for arm64 fails during linking
I try to cross-compile a simple package for the aarch64 architecture with a x86_64 computer. The aarch64 libs are in place and my toolchain looks like this:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_FIND_ROOT_PATH /usr /usr/lib/aarch64-linux-gnu /opt/ros/kinetic /lib/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_LIBRARY_PATH /usr/lib/aarch64-linux-gnu)
set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/)
But now I'm stuck with the following error:
Linking CXX executable /home/martin/Desktop/AARCH64/test/devel_isolated/beginner_tutorials/lib/beginner_tutorials/talker
/usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: warning: libicudata.so.55, needed by //usr/lib/aarch64-linux-gnu/libicuuc.so.55, not found (try using -rpath or -rpath-link)
//usr/lib/aarch64-linux-gnu/libicuuc.so.55: undefined reference to `icudt55_dat'
collect2: error: ld returned 1 exit status
CMakeFiles/talker.dir/build.make:113: recipe for target '/home/martin/Desktop/AARCH64/test/devel_isolated/beginner_tutorials/lib/beginner_tutorials/talker' failed
make[2]: *** [/home/martin/Desktop/AARCH64/test/devel_isolated/beginner_tutorials/lib/beginner_tutorials/talker] Error 1
CMakeFiles/Makefile2:325: recipe for target 'CMakeFiles/talker.dir/all' failed
make[1]: *** [CMakeFiles/talker.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
The files /usr/lib/aarch64-linux-gnu/libicuuc.so.55 and /usr/lib/aarch64-linux-gnu/libicudata.so.55 exist. But why is there a "undefined reference" error? Both files are copied from the arm64 target board. Is it possible to ignore this error and continue compilation?
Do you have a hint for me? :) Thanks in advance!
Firstly, you should check if the sybolic links points to a valid libraries (if you copied it from target board). It means, check
$ file /usr/lib/aarch64-linux-gnu/libicuuc.so.55
etc.For example pcl_kdtree lib (on my local x86 notebook):
And check if your ending point is compiled on the proper architecture:
Hi, the links and files are correct, I think:
and
Hi, i have the same problem trying to cross-compile ROS application to aarch64.
Did you can resolv it?