Native Methods in Kaffe (SunOS)

Jesudas Mathew jm at cs.adelaide.edu.au
Fri Jun 5 00:15:43 PDT 1998


I have recently compiled kaffe (snap release of 4/6) under both SunOS & Linux,
and have trying to test out native methods. Kaffe seems to work quite well but
I have been having trouble getting native methods working under SunOS.
I have managed to successfully use native methods in Linux, but when I try to 
compile a program (the HelloWorld  example from the Javasoft site) I get the 
following error under SunOS.
 
gcc -shared -I/users/cs/jm/Kaffe/include HelloWorldImp.c -o libhello.so
collect2: ld returned 2 exit status
ld: /usr/tmp/cca241151.o: assert pure-text failed: reference to [offset] at 3c in /usr/tmp/cca241151.o
 
ld: /usr/tmp/cca241151.o: assert pure-text failed: reference to [offset] at 40 in /usr/tmp/cca241151.o
 
ld: /usr/tmp/cca241151.o: assert pure-text failed: reference to _printf at 44 in /usr/tmp/cca241151.o
 
I was wondering if anyone had been successful in getting native methods to 
work under SunOS. My knowledge of C is somewhat limited & I get to hack at the
distribution to get it to compile, as well as getting help from Kiyo. So I 
suspect it might not be working due to a change I made. The changes I made 
where
 
1) The compiler was complaining about multiple definitions, so I had to remove
 the definitions for sendto, setsockopt, getsocketopt from md.h. Since these
 relate to sockets and the java.net package seems to be working I assume that
 this is OK.
 
 2) The compiler also complained about vfprintf being multiply defined so I had
 to remove this definition from md.h also.
 
 3) When compiling jni.c I got a strange error complaining about <stdio.h>.
 I eventually traced this to jmalloc.h: calloc weas already defined so I had to
 remove the macro referring to it in jmalloc.h This enabled the compile to 
 continue, but I have no idea if this is causing my problems. I am just 
 suspicious since I presume the jni.c file relates to native methods.
 
 Another problem I have found (under both Linux & SunOS) is that I get the 
 following error when I try to make a system call
 
 java.io.IOException: No such file or directory
 The same program works fine under JDK 1.1.*. Can anyone tell me whether system
 calls should work in Kaffe?
 
 
Thanks in advance,
Jesudas
-- 
Jesudas Mathew					|  
Distributed High Performance Computing Project	|  Email: jm at cs.adelaide.edu.au
Department of Computer Science			|  Phone: +61 8 8303 4728
The University of Adelaide, Australia 5005	|


More information about the kaffe mailing list