Building c++ JNI so's for ABI compatability with JDK1.4
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   rich_paul
Posted On:   Tuesday, March 19, 2002 12:11 PM

--- CUT HERE --- #include #include "HelloWorld.h" #include "stdio.h" #include JNIEXPORT void JNICALL Java_HelloWorld_sayHello(JNIEnv *env, jobject obj) { printf("Hello, world! "); try { throw 0; } catch ( int i ) { printf("Caught: %d "); }; printf("~Hello, world! "); return; }; --- CUT HERE --- This is, as has been often said, due to the differant c++ toolchain and shared libraries used to compile the JDK itself: egcs-1.1.2, and libstdc++-libc6.1-1.so.2. What I have never heard discussed is how to build a toolchain tha   More>>
			
--- CUT HERE ---
#include
#include "HelloWorld.h"
#include "stdio.h"
#include

JNIEXPORT void JNICALL Java_HelloWorld_sayHello(JNIEnv *env, jobject obj) {
printf("Hello, world!
");
try {
throw 0;
} catch ( int i ) {
printf("Caught: %d
");
};
printf("~Hello, world!
");
return;
};
--- CUT HERE ---



This is, as has been often said, due to the differant c++ toolchain and shared
libraries used to compile the JDK itself: egcs-1.1.2, and libstdc++-libc6.1-1.so.2. What I have never heard discussed is how to build a
toolchain that does not have these problems.


Right now, my biggest problem appears to be chicken and egg. I have tried building egcs under slackware, and it cannot compile the libstdc++ it includes. It appears that this is a problem with my (newer, of course) libc.


So the question is this: All of the applications on my box, including Oracle, mozilla, netscape and the infamous JDK1.4 seem to be using either egcs-1.1.2 or gcc-2.95.3, seem to be linking to one of two oddly named libstdc++ instances, and seem to be pretty happy with doing it. Somebody must have agreed that this toolchain was 'the thing to use' to compile compatable c++ for many linuxes. So where did they get the toolchain, and where can I get it?


Also, can you define FCS, and tell me if it relates to this discussion? I
noticed it in the blackdown package names, and suspect that it's some standard that I should have read long, long ago. But web searches turn up too much cruft to be useful.


If I can find such a toolchain, I'd be happy to recompile it with itself for compatibility with other systems and make it availiable to others.

   <<Less

Re: Building c++ JNI so's for ABI compatability with JDK1.4

Posted By:   Nathan_Meyers  
Posted On:   Tuesday, March 19, 2002 05:48 PM

The C++ ABI problem is messy, and may have different answers for different JDK releases. I recommend asking on the Blackdown mailing list (http://www.blackdown.org); you should at least be able to get an answer for the JDK distributed by Blackdown.


As for FCS, that's not a standard at all - just an acronym for the real release, to distinguish it from pre-releases. It means something like "Final Customer Ship" or "First Customer Ship"... or maybe "Friendly Customer Stuff" :-).

About | Sitemap | Contact