This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SEGV


On Saturday, September 22, 2001, at 07:20  AM, Johannes Zellner wrote:

> after some frustrations with both blackdown's and gcj's jni, I compiled
> libgcj / libgcjgc with symbols and immediatly run into SEGFAULTS:

This is happening because, for some reason, libgcj's C++ static 
initializers havn't been run yet. The linker should have arranged for 
them to be run prior to main() being called. Are you doing anything 
special when compiling/linking your Java app which might be causing 
that? If not, something may be screwy with your GCC installation.

> did gcj's jni work ever ?

Yes. I know of several people who are successfully using JNI with GCJ. 
FWIW, I tried the test case you posted yesterday (on Linux using a 
recent CVS snapshot of GCC) and it works fine for me:

$ gcj -v
Reading specs from /home/bryce/gcc/bin/../lib/gcc-lib/i686-pc-linux-
gnu/3.0.1/specs
Reading specs from /home/bryce/gcc/bin/../lib/gcc-lib/i686-pc-linux-
gnu/3.0.1/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../configure --with-gcc-version-
trigger=/home/bryce/cvs/gcc3/gcc/version.c --host=i686-pc-linux-gnu 
--enable-threads=posix --prefix=/home/bryce/gcc31 --enable-shared 
--enable-languages=java
Thread model: posix
gcc version 3.1 20010909 (experimental)

$ gcj test.c -o test1
$ ./test1
test: success

regards

Bryce.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]