Problems using a compiled jar with gcj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am trying to use Java scripting (JSR 223) with GCJ.
To do that I tried compiling the scripting jar file that implements JSR 223 
into a shared library and to use it in my app.
However I always get a SIGSEGV in the init function of the shared library.

As you can see (in the build.sh script) I tried all combinations of
-findirect-dispatch and -fno-indirect-classes without success.

Any help to get that running is highly appreciated.

Thanks in advance!

Lothar
$ tar -xvf gcjtest.tar.bz2 
gcjtest/build.sh
gcjtest/main.cpp
gcjtest/ReflectionHack.cpp
gcjtest/scripting.jar

$ cd gcjtest/

$ ./build.sh 
/tmp/cc6tAZxS.o: In function `main':
/tmp/gcjtest/main.cpp:35: undefined reference to `javax::script::ScriptEngineManager::class$'
/tmp/gcjtest/main.cpp:35: undefined reference to `javax::script::ScriptEngineManager::ScriptEngineManager()'
/tmp/gcjtest/main.cpp:41: undefined reference to `javax::script::ScriptEngine::class$'
collect2: ld returned 1 exit status
./build.sh: line 30:  4571 Segmentation fault      LD_LIBRARY_PATH=. ./testgcj0
./build.sh: line 31: ./testgcj1: No such file or directory
./build.sh: line 32:  4573 Segmentation fault      LD_LIBRARY_PATH=. ./testgcj2

$ LD_LIBRARY_PATH=. gdb ./testgcj0
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/gcjtest/testgcj0...done.
(gdb) r
Starting program: /tmp/gcjtest/testgcj0 
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68b0730 in ?? () from /usr/lib/libgcj.so.10
(gdb) where
#0  0x00007ffff68b0730 in ?? () from /usr/lib/libgcj.so.10
#1  0x00007ffff5fe2e84 in _Jv_AllocString () from /usr/lib/libgcj.so.10
#2  0x00007ffff602d7b2 in _Jv_NewStringLatin1 () from /usr/lib/libgcj.so.10
#3  0x00007ffff6029cb6 in _Jv_CheckABIVersion(unsigned long) () from /usr/lib/libgcj.so.10
#4  0x00007ffff6029e9d in _Jv_RegisterClasses () from /usr/lib/libgcj.so.10
#5  0x00007ffff7bc48c6 in _init () from ./libscripting0.so
#6  0x00007ffff7fd5988 in ?? ()
#7  0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe2c8, env=0x7fffffffe2d8) at dl-init.c:70
#8  _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe2c8, env=0x7fffffffe2d8) at dl-init.c:134
#9  0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe59c in ?? ()
#12 0x0000000000000000 in ?? ()
(gdb) q
A debugging session is active.

        Inferior 1 [process 4586] will be killed.

Quit anyway? (y or n) y

$ LD_LIBRARY_PATH=. gdb ./testgcj2
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/gcjtest/testgcj2...done.
(gdb) r
Starting program: /tmp/gcjtest/testgcj2 
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68a8730 in ?? () from /usr/lib/libgcj.so.10
(gdb) where
#0  0x00007ffff68a8730 in ?? () from /usr/lib/libgcj.so.10
#1  0x00007ffff5fdae84 in _Jv_AllocString () from /usr/lib/libgcj.so.10
#2  0x00007ffff60257b2 in _Jv_NewStringLatin1 () from /usr/lib/libgcj.so.10
#3  0x00007ffff6021cb6 in _Jv_CheckABIVersion(unsigned long) () from /usr/lib/libgcj.so.10
#4  0x00007ffff6021e9d in _Jv_RegisterClasses () from /usr/lib/libgcj.so.10
#5  0x00007ffff7bbe2be in _init () from ./libscripting2.so
#6  0x00007ffff7fd5988 in ?? ()
#7  0x00007ffff7dead65 in call_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe2c8, env=0x7fffffffe2d8) at dl-init.c:70
#8  _dl_init (main_map=0x7ffff7ffe128, argc=1, argv=0x7fffffffe2c8, env=0x7fffffffe2d8) at dl-init.c:134
#9  0x00007ffff7ddcb2a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffe59c in ?? ()
#12 0x0000000000000000 in ?? ()
(gdb) q
A debugging session is active.

        Inferior 1 [process 4594] will be killed.

Quit anyway? (y or n) y


Attachment: gcjtest.tar.bz2
Description: application/bzip-compressed-tar


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux