Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide native libraries inside a jar? #92

Open
netvl opened this issue Jan 2, 2018 · 2 comments
Open

Provide native libraries inside a jar? #92

netvl opened this issue Jan 2, 2018 · 2 comments

Comments

@netvl
Copy link

netvl commented Jan 2, 2018

Many projects provide native libraries inside their jar files, e.g. Netty or LWJGL. However, libsodium-jni does not provide it - apparently, .so files are only present in the AAR package, but not in the regular JAR library. Moreover, it looks like that x86_64 shared object from the AAR file is not usable directly on a regular Linux system:

./libsodiumjni.so: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header

(at least on my system, /usr/libc/libc.so is a textual stub; the proper library is /usr/libc/libc.so.6)

Therefore, there is no simple way to use the library - there is a need to compile the library manually and also add the compiled files to the project by hand. Is it possible to fix this?

@joshjdevl
Copy link
Owner

This is possible, though would prefer to package it according to some well adopted practice regarding the packaging and location of the shared object files inside the jar.

Android Archive Library (AAR) is packaged according to the Android requirements.

Are there any well known requirements or practices regarding packaging the shared objects in jar? Links? Pull requests are welcome as well.

Also, we would package this as a third dependency jar.

@joshjdevl
Copy link
Owner

Also, Java 8 supports loading static libraries. I wonder that might fix the path issue mentioned and that's bound to happen.

http://openjdk.java.net/jeps/178

The static library is located in

./libsodium/libsodium-host/lib/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants