Hello, I resolved the problem by imitating the concept of Makefile.reak in xcross. The next step will be to implement my own loader to replace libdl.
Konstantin Tcholokachvili 2010/9/1, Konstantin Tcholokachvili <[email protected]>: > Hello, > > I'm trying to compile NekoVM with NEKO_STANDALONE flag to see how it > behaves. > > I created a .c file versatile_kernel.c (inspired from Xcross) which > implements neko_standalone_* functions: > > ------------ versatile_kernel.c BEGIN --------------- > > #include <stdio.h> > #include "neko_vm.h" > > extern void std_main(); > > void neko_standalone_init() > { > std_main(); > > } > > void neko_standalone_error(const char *error) > { > fprintf(stderr, "Error: %s\n", error); > } > > > value neko_standalone_loader(char **argv , int argc) > { > return neko_default_loader(argv, argc); > } > > ------------ versatile_kernel.c END --------------- > > > I also modified the following lines of the Makefile (inspired from Xcross): > > ---------------- Makefile BEGIN ---------------- > > CFLAGS = -Wall -O3 -fPIC -fomit-frame-pointer -I vm -D_GNU_SOURCE > -DNEKO_STANDALONE > > > VERSATILE_KERNEL_PORTS = vm/versatile_kernel.o ${STD_OBJECTS} > ${LIBNEKO_OBJECTS} ${VM_OBJECTS} > > test: createbin port compiler libs > > port: ${VERSATILE_KERNEL_PORTS} > ${CC} ${CFLAGS} ${EXTFLAGS} -o $@ ${VERSATILE_KERNEL_PORTS} > ${LIBNEKO_LIBS} > mv port bin/neko > > > ---------------- Makefile END ------------------ > > > When I do: > make test > > It ends with the message (when it comes to compiler rules) : > Uncaught exception - load.c(352) : Peimitive not found : s...@sprintf(2) > > This is probably because I call std_main(); in neko_standalone_init(). > > Can someone tell if there is a special trick to build a standalone > version or what I did wrong? > > Thanks in advance. > > Konstantin Tcholokachvili > > > 2010/8/29, Nicolas Cannasse <[email protected]>: >> Le 29/08/2010 23:48, Konstantin Tcholokachvili a écrit : >>> Hello, >>> >>> I modified the Makefile a little bit in order to add NEKO_STANDALONE >>> to CFLAGS but I have some compilation problems. >> >> Check the xcross Makefile : >> >> http://code.google.com/p/xcross/source/browse/trunk/Makefile.real >> >> Nicolas >> >> -- >> Neko : One VM to run them all >> (http://nekovm.org) >> > -- Neko : One VM to run them all (http://nekovm.org)
