All,
I've been working with the dataspace calls with the L4Env running x86 Fiasco. I am trying to create a dataspace from a L4Linux user process, but I am having trouble getting the program to compile. Is my Makefile correct for what I am trying to do? Is there any reason I shouldn't be able to link to l4dm_mem_open from a L4Linux user process? Below is my source, Makefile, and compiler error message. Help much appreciated!
---------- SOURCE ---------- #include <l4/dm_mem/dm_mem.h> #include <l4/l4rm/l4rm.h>
#include <l4/sys/types.h> #include <l4/dm_generic/types.h>
int main(int argc, char**argv){ l4dm_dataspace_t ds; void *addr;
l4dm_mem_open(L4DM_DEFAULT_DSM,8192,0,0,"L4RM example",&ds); printf("hi\n");
return 0; }
---------- MAKEFILE ---------- PKGDIR ?= ../.. L4DIR ?= $(PKGDIR)/../..
TARGET = $(PKGNAME)
MODE = host SYSTEMS = x86-l4v2 x86-l4x0
# list your .c files here SRC_C = main.c
LIBCINCDIR = $(addprefix -I,$(L4INCDIR))
# if your server implements the server side of an idl defined in an idl-file # of your package, list the idl file name(s) here (no path needed) SERVERIDL =
# list additional library paths and libraries here LIBS = -ldm_generic -ldm_mem
include $(L4DIR)/mk/prog.mk
---------- COMPILER ERROR ---------- jgrizza@tomato:~/build_2.6.01/l4/pkg/create_ds/server/src$ make PWD=/home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/OBJ-x86_586-l4v2 make -C OBJ-x86_586-l4v2 -f Makefile make[1]: Entering directory `/home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/OBJ-x86_586-l4v2' ... Compiling main.o LD_PRELOAD=/home/jgrizza/build_2.6.01/l4/tool/gendep/libgendep.so GENDEP_TARGET=main.o GENDEP_BINARY=cc1 gcc -c -DRAM_BASE=0x0 -DUSE_OSKIT=y -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2 -I../../../idl/OBJ-x86-l4v2 -I../../../../../include/x86/l4v2 -I/home/jgrizza/build_2.6.01/drops/include/x86/l4v2 -I../../../../../include/l4v2 -I/home/jgrizza/build_2.6.01/drops/include/l4v2 -I../../../../../include/x86 -I/home/jgrizza/build_2.6.01/drops/include/x86 -I../../../../../include -I/home/jgrizza/build_2.6.01/drops/include -gstabs+ -g -O2 -fno-strict-aliasing -march=i586 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations /home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/main.c -o main.o /home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/main.c: In function `main': /home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/main.c:12: warning: implicit declaration of function `printf' /home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/main.c:9: warning: unused variable `addr' ==> Linking create_ds LD_PRELOAD=/home/jgrizza/build_2.6.01/l4/tool/gendep/libgendep.so GENDEP_TARGET=create_ds GENDEP_BINARY=ld gcc -o create_ds main.o -L../../../../../lib/x86_586/l4v2 -L/home/jgrizza/build_2.6.01/drops/lib/x86_586/l4v2 -L../../../../../lib/x86_586 -L/home/jgrizza/build_2.6.01/drops/lib/x86_586 -L../../../../../lib -L/home/jgrizza/build_2.6.01/drops/lib -ldm_generic -ldm_mem ../../../../../lib/x86_586/l4v2/libdm_mem.a(open.o)(.text+0xba): In function `l4dm_mem_open': /home/jgrizza/build_2.6.01/l4/pkg/dm_mem/lib/clientlib/src/open.c:87: undefined reference to `LOG_logL' ../../../../../lib/x86_586/l4v2/libdm_mem.a(open.o)(.text+0xff):/home/jgrizza/build_2.6.01/l4/pkg/dm_mem/lib/clientlib/src/open.c:62: undefined reference to `l4env_get_default_dsm' ../../../../../lib/x86_586/l4v2/libdm_mem.a(open.o)(.text+0x12b):/home/jgrizza/build_2.6.01/l4/pkg/dm_mem/lib/clientlib/src/open.c:65: undefined reference to `LOG_logL' collect2: ld returned 1 exit status make[1]: *** [create_ds] Error 1 make[1]: Leaving directory `/home/jgrizza/build_2.6.01/l4/pkg/create_ds/server/src/OBJ-x86_586-l4v2' make: *** [OBJ-x86_586-l4v2] Error 2
Thanks!
Julian