gij gcj-dbtool and questions
Jakob Praher
jpraher@yahoo.de
Mon Dec 27 12:34:00 GMT 2004
hi all,
after some research, I've resolved the problem with the gcj-dbtool.
apparently the idea is that
VMCompiler.compileClass( ClassLoader, String, ... )
does the mapping from jar file/bytecode to shared objects, and the class
loaders are not aware of shared libs at all.
This was my mistake, since the ClassLoader, namely VMClassLoader must be
able to find a jar/class file that matches the requested class.
Otherwise it throws the ClassNotFoundException and never calls the
VMCompiler.compileClass method. (which happens in the defineClass of the
VMClassLoader)
BTW: In the end pnuts is still promlematic, but at least I've gained
some insights how the gij/gcj-dbtool stuff works.
anyway nice holidays
-- Jakob
Am Donnerstag, den 23.12.2004, 00:16 +0100 schrieb Jakob Praher:
> hi all,
>> i am using gcc-head with then new-abi stuff.
>> wanted to try to get started by using pnuts, a scripting language for
> java to run with gij.
>> so i did the following:
>> gcj -findirect-dispatch -shared -o libpnuts.so pnuts.jar
> gcj-dbtool -n pnuts.db
> gcj-dbtool -a pnuts.jar libpnuts.so
>> gij -Dgnu.gcj.precompiled.db.path=./pnuts.db pnuts.tool.Main
>> prints:
>> Exception in thread "main" java.lang.NoClassDefFoundError:
> pnuts.tools.Main
> at gnu.java.lang.MainThread.run()
> (/home/jp/gcc-head/lib/libgcj.so.6.0.0)
> at _Jv_ThreadRun(java.lang.Thread)
> (/home/jp/gcc-head/lib/libgcj.so.6.0.0)
> at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean)
> (/home/jp/gcc-head/lib/libgcj.so.6.0.0)
> at main (/home/jp/gcc-head/lib/libgij.so.0.0.0)
> at __libc_start_main (/lib/tls/i686/cmov/libc-2.3.2.so)
>> and doing a
> strace 2>&1 -e open gij -Dgnu.gcj.precompiled.db.path=./pnuts.db
> pnuts.tool.Main | grep pnuts.db
>> yields that pnuts.db doesn't get loaded anyway - so how should it now
> about the mapping ....
>> I found that the only file that uses the gnu.gcj.precompiled.db.path
> property is java/lang/VMCompiler.java.
> But I have to confess that I didn't look more into the details. I am
> hoping to save some time and that you can give some details and status
> information.
>> BTW: Tom, I am interested in the gcjx stuff, your blog sounds pretty
> interesting to me. When are you planing on integrating in as a
> gcc-frontend...
> I am thinking about using relocation symbols and a more GOT/PLT like
> approach for doing BC compatible linking, also with an application to
> lazy procedure linking. I have invested pretty much time into the elf
> dynamic linking approach, since I was very interested how it all worked.
> I am currently writing a little documentation about that and have to
> talk to one of my profs, perhaps I can do some sort of this as a diploma
> thesis, which would be rather nice. The otable and atable stuff is
> rather straightforwared to implement in pure elf, but the itable thing,
> is a little bit more tricky, I suppose. After all that calls
> _Jv_LookupInterfaceMethodIdx, which is a bit more tricky to implement as
> elf sections....
> Anyways I am providing more information on that, if you are interested.
>> Whishing you a mary chrismas, if that applies to you :-).
>--
Jakob Praher <jpraher@yahoo.de>
More information about the Java
mailing list