Hi Alan, On 12/05/2020 19:57, Alan Bateman wrote: > Looks okay to me.
I am glad to hear that and also to see this fixed quickly (thanks Bob for posting the patch). I'd like to see it backported to jdk11u (via jdk14u, of course) if possible in order to allow stock jdk14u/11u to be used to build GraalVM native images. I was unaware that this was a spec requirement for static libs. Can you point me at any discussion that explains why this is required and what the function might be expected to do? or even tell me when it was added to the spec? The macro appears to implement an empty function. Is there any expectation/requirement that it could/should do something more than that? I am also wondering if this is the only such omission or if other libs might require a corresponding JNI_OnLoad_extnet_xxx function. regards, Andrew Dinn ----------- > On 12/05/2020 19:46, Bob Vandette wrote: >> BUG: >> >> https://bugs.openjdk.java.net/browse/JDK-8244853 >> >> Please review this simple fix for JDK 15 which adds the required >> JNI_OnLoad_extnet function to the libextnet.a >> static library when it is built. >> >> the JDK 15 make static-libs-image target currently builds this static >> library but it is not spec compliant and >> causes the GraalVM native-image utility to fail generating executables >> due to the lack of the OnLoad symbol. >> >> >> CHANGE: >> >> diff --git a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c >> b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c >> --- a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c >> +++ b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c >> @@ -34,6 +34,11 @@ >> #include "jdk_net_LinuxSocketOptions.h" >> /* >> + * Declare library specific JNI_Onload entry if static build >> + */ >> +DEF_STATIC_JNI_OnLoad >> + >> +/* >> * Class: jdk_net_LinuxSocketOptions >> * Method: setQuickAck >> * Signature: (II)V >> diff --git a/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c >> b/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c >> --- a/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c >> +++ b/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c >> @@ -32,6 +32,11 @@ >> #include <netinet/in.h> >> #include "jni_util.h" >> +/* >> + * Declare library specific JNI_Onload entry if static build >> + */ >> +DEF_STATIC_JNI_OnLoad >> + >> static jint socketOptionSupported(jint sockopt) { >> jint one = 1; >> jint rv, s; >> diff --git >> a/src/jdk.net/solaris/native/libextnet/SolarisSocketOptions.c >> b/src/jdk.net/solaris/native/libextnet/SolarisSocketOptions.c >> --- a/src/jdk.net/solaris/native/libextnet/SolarisSocketOptions.c >> +++ b/src/jdk.net/solaris/native/libextnet/SolarisSocketOptions.c >> @@ -32,6 +32,11 @@ >> static int initialized = 0; >> /* >> + * Declare library specific JNI_Onload entry if static build >> + */ >> +DEF_STATIC_JNI_OnLoad >> + >> +/* >> * Class: jdk_net_SolarisSocketOptions >> * Method: init >> * Signature: ()V > -- regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill