Closed v2aus closed 6 months ago
Hi @v2aus ,
I'm sorry for not getting back to you sooner. This question in Stackoverflow seems to be relevant. https://stackoverflow.com/questions/46999056/crosscompile-undefined-reference-to-std-atomic-futex-unsigned-base-m-futex
Maybe commenting out the 'find_package(Threads)' line in CMakeLists.txt is a possible workaround because the error message seems to be related to multi-threading.
@v2aus
If you are on a Debian-based distro, the following workaround should work:
Remove -mno-omit-leaf-frame-pointer
from CMakeLists.txt
set ENABLE_ARM_NEON
to OFF
(as you mentioned)
Prepare cross-compiling environment
sudo apt install g++-arm-linux-gnueabihf
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install libc6:armhf libstdc++6:armhf
cmake with specifying the compiler
cmake -B./build-32bit -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -G Ninja
For example,
file build-32bit/bin/libopen_htj2k_R.so
returns
build-32bit/bin/libopen_htj2k_R.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=64c71389dd4b344e258df37e549ac8e4acbc5a2e, not stripped
and all the tests have been passed.
Hello. It seems that OpenHTJ2K now doesn't support armv7-a. I tried to modify the CmakeLists.txt to cross-compile the source code with GCC 6.3.0. Finally, I failed. I set CMAKE_CXX_STANDARD to 14 and CMAKE_HOST_SYSTEM_PROCESSOR to arm32, and then I added some code about CMAKE_HOST_SYSTEM_PROCESSOR matching arm32 to CmakeLists.txt. I set ENABLE_ARM_NEON to "OFF" because there is no definition of vaddv_u8(). I set -march=armv7-a -mtune=cortex-7a. At last, the compilation went to the following step:
I'd like to know whether it is because something is wrong with my modification of the CmakeLists.txt, or the source code now does not support armv7-a.