Reputation: 55
I would like to use a shared library, that is compiled for arm64, on Android. I have my .so file inside a aarch64-linux-gnu
folder, but for other libraries I have instead a aarch64-linux-android
folder.
Please can these libraries compiled for aarch64-linux-gnu
run on an arm64 Android device? What do these names stand for precisely? I know that aarch64
refers to the arm64 processor architecture but I don't know how the operating system is related here.
Thank you!
Upvotes: 3
Views: 2504
Reputation: 25895
Android and ARM my have some libraries that are the same. Basically the SO
file has to be able to find all the libraries it was linked against to run, and the versions need to match up so nothing breaks. This is risky, and it is generally safest to compile the entire program on your target machine. You can see if everything can be located/what is missing using:
ldd /path/to/file.so
this will give you a list of libraries and where the file thinks they are - or ??? if it can't find it. You need to double check and see if the results of this look OK.
Even if all dependencies are found, mismatch in versions or architecture will cause the program to break at run-time. You need to extensively test the use of the externally linked library and even then you may miss some cases that break your program. For this reason I would try and get the source code if possible, and re-compile everything on the target machine.
Upvotes: 2