On Thu, 19 Dec 2024 02:51:51 GMT, David Holmes <dhol...@openjdk.org> wrote:
> > The solution chosen by the original implementors of static builds was to > > look for a symbol JNI_OnLoad_someInternalLibrary, and if it was found, skip > > loading the dynamic library. > > Is that necessary? Presumably if you try to dynamically load a statically > linked library it will fail. Does the failure indicate the reason? If so then > just ignore it. It is perhaps not necessary, but this is the way it is implemented, and had been for years. Just as you like to be conservative and don't change things that's been working for years, so am I a bit reluctant to change this behavior. Doing so would be a massive undertaking, on a completely different scale than just fixing a few issues to get the Windows static launcher to work properly. > > It does have the advantage that users can add static libraries of their own > > in this way. > > Is this intended to be a supported mechanism? That needs to be specified and > documented somewhere if so. Yes it is. It is documented in the JNI specification: https://docs.oracle.com/en/java/javase/23/docs/specs/jni/invocation.html#jni_onload_l ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2553349041