This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: win32: Why exports of JNI_* symbols from _exe_ files


Danny Smith wrote:
> I notice that 
> JNI_CreateJavaVM@12
> JNI_GetCreatedJavaVMs@12
> JNI_GetDefaultJavaVMInitArgs@4
> 
> end up in export table of all gcj-built .exe files
> (with newer binutils that handle exports from exe's).
> This is because they are marked as dllexport in jni.cc 
> even when jni.o gets archived into a static libgcj.a.

This is my doing. :-) I submitted this patch
to be compatible with Sun's JDK on Win32.

However, Sun's JDK has a "jvm.dll" while we
(currently) have everything statically linked
in.

I think the more correct definition would be
something like:

  #ifdef LIBGCJ_IS_A_DLL
    #ifdef __GCJ_JNI_IMPL__
      #define JNIIMPEXP JNIEXPORT
    #else
      #define JNIIMPEXP JNIIMPORT
    #endif /* ! __GCJ_JNI_IMPL__ */
  #else
    #define JNIIMPEXP
  #endif

"LIBGCJ_IS_A_DLL" should be replaced with whatever
we #define when libgcj is built as a DLL (is there
anything like this?).


> Is there a reason for these symbols always to be exported from
> .exe file?

Not really. My bad.

Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT hotmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]