[7u40] Request for review: [macosx] jawt_md.h shipped with jdk is outdated

David DeHaven david.dehaven at oracle.com
Fri May 17 08:00:09 PDT 2013


>>> The fix looks good to me. Only one question:
>>> 
>>> src/macosx/javavm/export/jni_md.h
>>>>  29 #define JNIEXPORT
>>> 
>>> Does the empty #define imply that when building a jni lib on Mac, it should export all of its symbols by default?
>> 
>> It depends on gcc's visibility setting, but yes, by default all symbols are exported.
>> 
>> JDK8 has a better jni_md.h that sets JNIEXPORT to __attribute__(visibility(("default"))). That change should be backported, but should probably need to be done under a different bug ID. I suppose I could sneak it in here :)
> 
> IIRC, Martin Buchholz's fix only updated the jni_md.h for Solaris, so the Mac's one is unlikely to change even if his fix is back-ported. Hence I'd vote for adding the __attribute__(visibility(("default"))) in your fix (unless this can break anything - recall the changes needed in awt_LoadLibrary.c where the JNIEXPORT was used in a typedef).

The Mac builds currently use the solaris headers in both versions (which is why I was so interested in helping him). I haven't tried building 7u-dev with the attribute set yet, so I'm not sure of the consequences in JDK7. I can give it a try, if it's too ugly I'll file a separate issue to do the backport.


> Also, I assume you're going to forward-port your fix to JDK 8 at some point?

Yes, that's my plan.

-DrD-



More information about the macosx-port-dev mailing list