[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2007-01-30 Thread tromey at gcc dot gnu dot org


--- Comment #9 from tromey at gcc dot gnu dot org  2007-01-30 21:03 ---
This was fixed a while ago.


-- 

tromey at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-08-07 Thread tromey at gcc dot gnu dot org


--- Comment #8 from tromey at gcc dot gnu dot org  2006-08-07 16:30 ---
I think comment #3 explains the problem.
So, this is either a more general GCC bug, or it is not a bug at all.
In any case it isn't a gcj problem :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-07-06 Thread bcmpinc at hotmail dot com


--- Comment #7 from bcmpinc at hotmail dot com  2006-07-06 12:37 ---

extern JNIEXPORT void JNICALL Java_JavaSide_sayHello (JNIEnv *env, jobject);

After preprossesing this becomes:

__attribute__((dllexport)) void __attribute__((__stdcall__))
Java_sample_myNative
  (JNIEnv *, jobject, jstring);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-07-05 Thread tromey at gcc dot gnu dot org


--- Comment #6 from tromey at gcc dot gnu dot org  2006-07-06 00:05 ---
Any word on this?


-- 

tromey at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread tromey at gcc dot gnu dot org


--- Comment #1 from tromey at gcc dot gnu dot org  2006-06-26 17:22 ---
Does the JDK's javah put that _ into the generated header?

I suspect that you are seeing a problem with the C compiler, not a problem
with JNI header generation.
In particular I think that _, most likely, should be added by the C
compiler and not added to the header.


-- 

tromey at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tromey at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread bcmpinc at hotmail dot com


--- Comment #2 from bcmpinc at hotmail dot com  2006-06-26 21:01 ---
(In reply to comment #1)
 Does the JDK's javah put that _ into the generated header?
No, JDK's javah creates a header equivalent to the header created by 'gcjh
-jni'.

 I suspect that you are seeing a problem with the C compiler, not a problem
 with JNI header generation.
I tried compiling with JDK's jni-headers and the javah-header. It still needs
the _ prepended.

 In particular I think that _, most likely, should be added by the C
 compiler and not added to the header.
I think you're right, but it's strange that the C compiler should recognize
that it's compiling a native java function. Most exported non-java functions
don't have a _ prepended, even if they're in a library containing a lot of
java functions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread dannysmith at users dot sourceforge dot net


--- Comment #3 from dannysmith at users dot sourceforge dot net  2006-06-26 
21:21 ---
I think you may be running into a compiler (MSVC vs GNUC) difference between
handling of __stdcall (==JNICALL) symbols.

For a function void __stdcall foo (int), 
both MSVC and GNUC generate an assembler name of '[EMAIL PROTECTED]'.  The 
underscore is
prefix to all assembler names, the @4 is unique to stdcall

MSVC uses the name '[EMAIL PROTECTED]' in the dll export table when exporting 
from a dll,
but '[EMAIL PROTECTED]' when exporting from a staticly linked object.

GNUC uses '[EMAIL PROTECTED]' in both. 

If you look in info for binutils, under dlltool, you will see 
 --ext-prefix-alias prefix Add aliases with prefix.
That might help.  However, I don't think that similar is supported by ld.

Danny


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread dannysmith at users dot sourceforge dot net


--- Comment #4 from dannysmith at users dot sourceforge dot net  2006-06-26 
22:26 ---
(In reply to comment #3)
 I think you may be running into a compiler (MSVC vs GNUC) difference between
 handling of __stdcall (==JNICALL) symbols.

Um, and this should all be taken care of by the #ifdef WIN32 code in
jni.cc:_Jv_LookupJNIMethod 

Danny


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153



[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.

2006-06-26 Thread tromey at gcc dot gnu dot org


--- Comment #5 from tromey at gcc dot gnu dot org  2006-06-27 03:20 ---
Yeah, jni.cc handles the lookup side of things.

The declaration side of things in user JNI code should be
handled by jni_md.h.  It has a bunch of win32-specific code
which boils down to:

#define JNIIMPORT__declspec(dllimport)
#define JNIEXPORT__declspec(dllexport)

#define JNICALL  __stdcall

It might be handy to see a small preprocessed source file.
Perhaps you're picking up the wrong jni.h, jni_md.h, or
perhaps the logic in jni_md.h is broken somehow.

Oops, I just looked at your version... jni_md.h is not in
3.4.  In 3.4 the same logic appears, only it is in jni.h.

It is possible that we fixed some bugs in this area since 3.4.
I don't remember.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28153