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

David DeHaven david.dehaven at oracle.com
Fri May 17 21:35:30 PDT 2013


Incidentally, I tried compiling with the JDK8 jni_md.h and it built fine... I didn't think the related changes were backported, or were they?

Either way, I think it needs to be a separate issue. Not that it matters, I'm off chasing fires with buckets of gasoline again... :(

-DrD-

> Thanks. I'm OK if this will be a separate bug.
> 
> --
> best regards,
> Anthony
> 
> On 05/17/2013 07:00 PM, David DeHaven wrote:
>> 
>>>>> 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