gij with gcc 2.95.2 (was: Re: internal error - SP mismatch)
James CE Johnson
jcej@tragus.org
Fri Mar 24 14:51:00 GMT 2000
Matt Welsh wrote:
> James CE Johnson <jcej@tragus.org> writes:
> >
> > By "latest libgcj" do you mean the stable 2.95.1 version or the one at the he
> > ad of
> > the CVS repository? Assuming you mean the former, I'm gonna go try that now.
>
> I'm sorry, I was wrong.
>
> I am using gcc-2.95.2 with Bryce's patches, as well as the latest
> version of libgcj *before* some changes were made to support throw/catch
> in CNI. This version is from
> 02 Mar 2000 00:00:00
> so you can get it with something like
> cvs co -D "March 2, 2000 00:00:00" libgcj
> Note that Bryce has a patch that you need to apply on top of this
> (libgcj-interface-dispatch-2.patch).
Ok, I'm getting a little closer now.
I've patched gcc 2.95.2 and the 3/2/2000 version of libgjc. I even have a shinny
new gij binary which was, after all, the point of the exercise.
But now, I'm embarrased to say, I can't seem to figure out how to use the darned
thing:
[jcej@node04 T3]$ gcj -shared -c -o HelloWorld.so HelloWorld.java
[jcej@node04 T3]$ gij HelloWorld
java.lang.ClassNotFoundException: HelloWorld
at 0x400e4e4b: java::lang::Throwable::Throwable(java::lang::String *)
(/usr/local/lib/libgcj.so.1)
at 0x400d8984: java::lang::Exception::Exception(java::lang::String *)
(/usr/local/lib/libgcj.so.1)
at 0x400d7cf4:
java::lang::ClassNotFoundException::ClassNotFoundException(java::lang::String *)
(/usr/local/lib/libgcj.so.1)
at 0x400fcc44: java::net::URLClassLoader::findClass(java::lang::String *)
(/usr/local/lib/libgcj.so.1)
at 0x400d71d6: java::lang::ClassLoader::loadClass(java::lang::String *, bool)
(/usr/local/lib/libgcj.so.1)
at 0x401331a4: _Jv_FindClass(_Jv_Utf8Const *, java::lang::ClassLoader *)
(/usr/local/lib/libgcj.so.1)
at 0x40130382: java::lang::Class::forName(java::lang::String *)
(/usr/local/lib/libgcj.so.1)
at 0x40133f8a: java::lang::FirstThread::run(void) (/usr/local/lib/libgcj.so.1)
at 0x400e20c2: java::lang::Thread::run_(void) (/usr/local/lib/libgcj.so.1)
at 0x40139aca: java::lang::Thread::run__(java::lang::Object *)
(/usr/local/lib/libgcj.so.1)
at 0x4014a6c2: _Jv_ThreadSetPriority(_Jv_Thread_t *, int)
(/usr/local/lib/libgcj.so.1)
at 0x401eaf16: GC_start_routine (/usr/local/lib/libgcjgc.so.1)
at 0x40203ccf: pthread_detach (/lib/libpthread.so.0)
at 0x402d71ba: __clone (/lib/libc.so.6)
addr2line: /proc/10380/exe: No such file or directory
[jcej@node04 T3]$ pwd
/home2/jcej/projects/personal/gcj/T3
[jcej@node04 T3]$ echo $CLASSPATH
/home2/jcej/projects/personal/gcj/T3
[jcej@node04 T3]$ echo $LD_LIBRARY_PATH
/home2/jcej/projects/personal/gcj/T3:/usr/local/lib
If I javac HelloWorld.java then things work. The complete example is at
http://www.lads.com/~jcej/gcj/T3/
But if I extend the example to do a CNI call then I find myself back in the same
boat. I put the entire test case at http://www.lads.com/~jcej/gcj/T4/ in case
anyone wants to point out the error of my ways... The file 'results' is the
output of compiling & trying to execute.
More information about the Java
mailing list