How to fix CMAKE Android-Toolchain RPATH Problem

Viewed 89

Im still on my big project with the topic of porting a big program written in c/c++ to Android.

It worked out fine so far and I could build it succesfully. But there is a problem when executing the files. First of all, there a problem with the libraries. I understand that RPATH is not provided with android.

So doing the following helped a little: LD_LIBRARIES_PATH=./lib programmBinary -v

This command shows the version info. However, if I want to execute the program with this command it is stuck. Every binary I want to execute with this command is stuck and hangs up. For example there is a binary file which creates an .img during the build process. The binary depends on several other files in order to build the .img file. All necessary file are on the device. When executing the command to create the image its immediately stuck.

Could that be a problem with this command?

I also tried changing my CMakeLists.txt and set the it to set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

Nothing changed. -v works and the rest not. Any idea?

Maybe the problem lays somewhere else? In addition, some infos: The program builds fine on linux. The .img File also creaties fine. Except when im using the LD_LIBRARIES_PATH=... command. Then I get an error message on Linux too. It says:

Error 3.1:  Failure during initialization: File "" is unreadable.
Logic error: Error building kernel image.  Image not saved.
fish: Job 1, 'LD_LIBRARY_PATH=./lib executable filename.img' terminated by signal SIGILL (Illegal instruction)

I appreciate any help. Thank

Thomas

0 Answers
Related