This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2006 21:21:03 -0000
- Subject: [Bug java/28153] Under Windows Xp the generated JNI headers need to have a '_' prepended for each function.
- References: <bug-28153-12871@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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 '_foo@4'. The underscore is
prefix to all assembler names, the @4 is unique to stdcall
MSVC uses the name '_foo@4' in the dll export table when exporting from a dll,
but 'foo@4' when exporting from a staticly linked object.
GNUC uses 'foo@4' 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