Load jawt library relative to sun.boot.library.path system on unix OSes#1422
Conversation
fd806d3 to
5fe6a2c
Compare
|
@neilcsmith-net this implementation is shamelessly based on your idea from here: I tested this with JDK 7, 8, 11 (OpenJDK builds) on Linux, with JDK 8 and 11 from Ubuntu Linux and with OpenJDK 8 builds on windows (to verify no negative effects on Windows). |
|
@matthiasblaesing 👍 well, my shame is not yet getting around to a PR! 😄 I have to say my approach would have been slightly different, to do this on the Java side inside Either way, fix highly appreciated! Thanks. |
|
Not having to modify native is always a good argument, one argument to look into this now was, that a fix for crash issues on mac OS M1 will need rebuilds anyway. |
At least Ubuntu builds the JDK with RUNPATH set instead of RPATH. The two differ in their effect on loading transitive dependencies. RPATHs effect also covers libraries loaded as transitive dependencies, while RUNPATH does not. In the case of JNA libjawt is loaded by libdispatch (the native JNA part), which makes it a transtive load. The solution is to load the library with the full path based on the sun.boot.library.path system property, which points to the native library dirs.
5fe6a2c to
f57c650
Compare
At least Ubuntu builds the JDK with RUNPATH set instead of RPATH. The
two differ in their effect on loading transitive dependencies.
RPATHs effect also covers libraries loaded as transitive dependencies,
while RUNPATH does not. In the case of JNA libjawt is loaded by
libdispatch (the native JNA part), which makes it a transtive load.
The solution is to load the library with the full path based on the
sun.boot.library.path system property, which points to the native
library dirs.