hello... 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 -L/home/tiago/drops/lib/x86_586/l4v2 -L../../../../../lib/x86_586 -L/home/tiago/drops/lib/x86_586 -L../../../../../lib -L/home/tiago/drops/lib -L/home/tiago/drops/lib -ldm_generic -ldm_mem -lnames -ll4util -lrmgr -lloaderif -ll4env -ll4env_err -lslab -ll4sys WOO_test.o(.text+0x17e): In function `std::vector<long long, std::allocator<long long>
::_M_insert_aux(__gnu_cxx::__normal_iterator<long long*,
std::vector<long long, std::allocator<long long> > >, long long const&)': /usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::allocate(unsigned)' WOO_test.o(.text+0x21a):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::deallocate(void*, unsigned)' WOO_test.o(.text+0x24e):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge](char const*, std::allocator<char> const&)' WOO_test.o(.text+0x2f8):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::deallocate(void*, unsigned)' WOO_test.o(.text+0x306):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)' WOO_test.o(.text+0x388):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::deallocate(void*, unsigned)' WOO_test.o(.text+0x3ae):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::deallocate(void*, unsigned)' WOO_test.o(.text+0x3d9):/usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)' WOO_test.o(.gnu.linkonce.t._ZNSt6vectorIxSaIxEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPxS1_EERKx+0xf3): In function `std::vector<long long, std::allocator<long long>
::_M_insert_aux(__gnu_cxx::__normal_iterator<long long*,
std::vector<long long, std::allocator<long long> > >, long long const&)': /usr/include/c++/3.3/bits/stl_iterator.h:642: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::deallocate(void*, unsigned)' WOO_test.o(.gnu.linkonce.t._ZNSt6vectorIxSaIxEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPxS1_EERKx+0x107): In function `std::vector<long long, std::allocator<long long>
::_M_insert_aux(__gnu_cxx::__normal_iterator<long long*,
std::vector<long long, std::allocator<long long> > >, long long const&)': /usr/include/c++/3.3/bits/stl_alloc.h:232: undefined reference to `std::__default_alloc_template<(bool)1, (int)0>::allocate(unsigned)' WOO_test.o(.eh_frame+0x12): In function `std::vector<long long, std::allocator<long long>
::_M_insert_aux(__gnu_cxx::__normal_iterator<long long*,
std::vector<long long, std::allocator<long long> > >, long long const&)': /usr/include/c++/3.3/bits/vector.tcc:224: undefined reference to `__gxx_personality_v0' encap.o(.text+0x430): In function `WOO_decide(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)': /usr/include/c++/3.3/bits/char_traits.h:127: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char>
::_Rep::_S_terminal'
encap.o(.eh_frame+0x11): In function `check_server()': /home/tiago/l4/pkg/WOO/examples/client/encap.cc:20: undefined reference to `__gxx_personality_v0'
###################################################
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?
Thanks
Tiago
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
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
ok... thanks for the patch... In the meanwhile i've hammered a solution... linking with the libstdc++ works out... the problem it was that i didn't noticed that i wasn't running the program in L4Linux... thats the problem of working on the deadline :). But the patch is cool, so that people can develop code to use my server without the need to know the libstdc++ port to L4.
Tiago
l4-hackers@os.inf.tu-dresden.de