Building binaries for L4Linux with IPC
Adam Lackorzynski
adam at os.inf.tu-dresden.de
Wed May 18 23:03:05 CEST 2005
On Wed May 18, 2005 at 12:13:27 +0100, Tiago Jorge wrote:
> I am trying now to do IPC to my server from L4Linux.
> I'm not doing a Lib. I'm picking up the client code generated from dice,
> build encapsulation code and i'm trying to use it in a simple program.
> I've made the makefile that looks like this:
>
> ###########################################
>
> PKGDIR ?= ../..
> L4DIR ?= $(PKGDIR)/../..
>
> TARGET = WOO_test
> SRC_CC = WOO_test.cc encap.cc WOO-client.cc
> MODE = l4linux
>
> include $(L4DIR)/mk/prog.mk
>
> ###########################################
>
> but the files are in c++. They compile right but when the link the give
> the following error:
>
> ###################################################
>
> ==> Linking WOO_test
> LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so
> GENDEP_TARGET=WOO_test GENDEP_BINARY=ld gcc -o WOO_test WOO_test.o
> encap.o WOO-client.o -L../../../../../lib/x86_586/l4v2
> what do i need to link to use c++ in l4linux? i can not link stdlibc++
> because it's not intended to use in L4linux...
> the lack of __gxx_personality_v0 is not due to linking with gcc because
> i link my server with gcc... and i use c++.
> How can i make this link with the correct c++ stdlib?
Simple answer, that's a bug in the build system. It is using gcc for
linking (see above) which is wrong for c++ as they need some libs that
gcc does not consider. The following should work:
Index: mk/prog.mk
===================================================================
RCS file: /home/cvs/l4/mk/prog.mk,v
retrieving revision 1.19
diff -u -r1.19 prog.mk
--- mk/prog.mk 11 Oct 2004 12:12:28 -0000 1.19
+++ mk/prog.mk 18 May 2005 21:01:36 -0000
@@ -95,9 +95,15 @@
DEPS += $(foreach file,$(TARGET), $(dir $(file)).$(notdir $(file)).d)
+# Link C++ programs with g++ (esp. in l4linux mode)
+LINK_PROGRAM := $(CC)
+ifneq ($(SRC_CC),)
+LINK_PROGRAM := $(CXX)
+endif
+
$(TARGET): $(OBJS) $(LIBDEPS) $(CRT0) $(CRTN)
@$(LINK_MESSAGE)
- $(VERBOSE)$(call MAKEDEP,$(INT_LD_NAME)) $(CC) -o $@ $(CRT0) $(OBJS) $(LDFLAGS) $(CRTN)
+ $(VERBOSE)$(call MAKEDEP,$(INT_LD_NAME)) $(LINK_PROGRAM) -o $@ $(CRT0) $(OBJS) $(LDFLAGS) $(CRTN)
@$(BUILT_MESSAGE)
endif # architecture is defined, really build
Adam
--
Adam adam at os.inf.tu-dresden.de
Lackorzynski http://os.inf.tu-dresden.de/~adam/
More information about the l4-hackers
mailing list