Re: Is statically linking NekoVM possible?
Konstantin Tcholokachvili <tcholoka <at> gmail.com>
2010-08-29 21:48:23 GMT
Hello,
I modified the Makefile a little bit in order to add NEKO_STANDALONE
to CFLAGS but I have some compilation problems.
1.
ld: warning: libgc.so.1, needed by bin/libneko.so, not found (try
using -rpath or -rpath-link)
I have libgc.so.1 in /usr/pkg/lib (I'm using NetBSD), I tried rpath
and -rpath-link but I get this message in all cases.
2.
main.c:(.text+0x532): undefined reference to `neko_standalone_init'
main.c:(.text+0x606): undefined reference to `neko_standalone_loader'
main.c:(.text+0x88c): undefined reference to `neko_standalone_loader'
As I guess I must define these functions somewhere, isn't it?
3.
vm/main.o: In function `report':
main.c:(.text+0x147): undefined reference to `neko_standalone_error'
bin/libneko.so: undefined reference to `GC_no_dls'
bin/libneko.so: undefined reference to `GC_malloc_ignore_off_page'
bin/libneko.so: undefined reference to `GC_malloc_uncollectable'
bin/libneko.so: undefined reference to `GC_gcollect'
bin/libneko.so: undefined reference to `GC_malloc_atomic_ignore_off_page'
bin/libneko.so: undefined reference to `GC_pthread_create'
bin/libneko.so: undefined reference to `GC_get_heap_size'
bin/libneko.so: undefined reference to `GC_get_free_bytes'
bin/libneko.so: undefined reference to `GC_free'
bin/libneko.so: undefined reference to `GC_set_warn_proc'
bin/libneko.so: undefined reference to `GC_malloc_atomic'
bin/libneko.so: undefined reference to `GC_malloc'
bin/libneko.so: undefined reference to `GC_init'
bin/libneko.so: undefined reference to `GC_dlopen'
bin/libneko.so: undefined reference to `GC_register_finalizer_no_order'
bin/libneko.so: undefined reference to `GC_all_interior_pointers'
bin/libneko.so: undefined reference to `GC_clear_roots'
bin/libneko.so: undefined reference to `GC_collect_a_little'
gmake: *** [bin/neko] Error 1
It's probably because of the first error case. But why libgc.so.1
isn't found? I specified it with:
LIBNEKO_LIBS = -L/usr/pkg/lib/ -lgc -lm
And what do you did to compile libneko.so as a static library
(libneko.a)? Addition
2010/8/26, Nicolas Cannasse <ncannasse <at> motion-twin.com>:
> Konstantin Tcholokachvili a écrit :
>> Helllo,
>>
>> In order to make a proof of concept OS kernel based on a VM I would know
>> if it's possible to statically link NekoVM to my kernel.
>> If I understood correctly until now NekoVM is only dynamically linked.
>>
>> Can someone give his insight on this subject?
>
> You might have a look at xcross (http://code.google.com/p/xcross) which
> does link statically the VM. It compiles neko with NEKO_STANDALONE flag
> which enable you to customize the way the VM is initialized.
>
> However, primitives are still resolved dynamically with dlsym() (after a
> dlopen(NULL)). You might prefer to create yourself a list of primitives
> and have a custom loader resolve them (see code in neko/vm/load.c)
>
> Nicolas
>
> --
> Neko : One VM to run them all
> (http://nekovm.org)
>
--
--
Neko : One VM to run them all
(http://nekovm.org)