This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: SEGV
- To: Johannes Zellner <johannes at zellner dot org>
- Subject: Re: SEGV
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Sat, 22 Sep 2001 14:58:05 +1200
- Cc: java gcc <java at gcc dot gnu dot org>
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.