Hello... As i said in earlier emails, i'm building a L4 server that needs network support. For that purpose, i'm trying to use the libraries from the FLIPS package, using as guideline the mini_http server. i've build my own package and costumized the Makefile to suit my needs. I've changed the mode to l4env_freebsd because i'm using C++ + STL, and i need the headers and the libstdc++.a. I've changed also the needed extra libraries as in the mini_http example. So the Makefile looks like this:
######################################
PKGDIR ?= ../.. L4DIR ?= $(PKGDIR)/../..
TARGET = $(PKGNAME) # the default relocation address. This may be superseded by a STATIC file. DEFAULT_RELOC = 0x01d00000
# list your .c files here SRC_CC = FailureDetector.cc
#Mode MODE = l4env_freebsd
#systems SYSTEMS = x86-l4v2
# 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 =
CXX_FLAGS = -nostdinc++ \ -I$(L4DIR)/include/g++-3 \ -I$(L4DIR)/include/drops
# list additional library paths and libraries here LIBS = -lstdc++ $(GCCLIB) -ldiet_be_socket_io -ll4vfs_net_io -ldiet_be_select -ll4vfs_select -ll4vfs_select_listener-server
include $(L4DIR)/mk/prog.mk
#####################################
the result when i build my program is the following error:
... Compiling FailureDetector.o LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=FailureDetector.o GENDEP_BINARY=cc1plus g++ -c -DRAM_BASE=0x0 -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2 -I../../../idl/OBJ-x86-l4v2 -I../../../../../include/x86/l4v2 -I/home/tiago/drops/include/x86/l4v2 -I../../../../../include/l4v2 -I/home/tiago/drops/include/l4v2 -I../../../../../include/x86 -I/home/tiago/drops/include/x86 -I../../../../../include -I/home/tiago/drops/include -nostdinc -DOSKIT -I../../../../../../oskit10/freebsd/libc/include -I../../../../../../oskit10/freebsd/3.x/src/include -I../../../../../../oskit10/freebsd/3.x/src/sys -I../../../../../../oskit10 -I../../../../../include/c++/3.3 -I../../../../../include/c++/3.3/drops -I/home/tiago/drops/include/oskit10 -I/home/tiago/drops/include/oskit10/oskit/freebsd -I/home/tiago/drops/include/c++/3.3 -I/home/tiago/drops/include/c++/3.3/drops -I/usr/lib/gcc-lib/i486-linux/3.3.4/include -gstabs+ -g -O2 -fno-strict-aliasing -march=i586 -Wall /home/tiago/l4/pkg/failuredetector/server/src/FailureDetector.cc -o FailureDetector.o ==> Linking failuredetector LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=failuredetector GENDEP_BINARY=ld gcc -o failuredetector ../../../../../lib/x86_586/crt0.o FailureDetector.o -Ttext=0x01d00000 -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../../../../../../oskit10/lib -L../../../../../lib/c++/3.3 -L/home/tiago/drops/lib/oskit10 -L/home/tiago/drops/lib/c++/3.3 -T../../../../../lib/x86_586/main_stat.ld -lstdc++ /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a -ldiet_be_socket_io -ll4vfs_net_io -ldiet_be_select -ll4vfs_select -ll4vfs_select_listener-server -static -loskit10_support_l4env_freebsd.o -ll4env -ll4rm -ldm_generic -ldm_mem -lthread -lsemaphore -lnames -ll4util -lrmgr -ll4env -lomega0 -llogserver -ll4env_err -ll4rm -ldm_generic -ldm_mem -lthread -lslab -ll4sys -nostdlib -Wl,--nostdlib -loskit_freebsd_c -loskit_freebsd_net -loskit_startup -loskit_clientos -loskit_bootp -loskit_linux_fs -loskit_fsnamespace -loskit_diskpart -loskit_linux_dev -loskit10_support_l4env_freebsd_dev -loskit_kern -loskit_lmm -loskit_amm -loskit_freebsd_c -loskit_com /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc_eh.a -loskit_freebsd_c -Ttext=0x01d00000 -Wl,-gc-sections ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.get_socket_server_thread+0x8b): In function `setsockopt': /home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:687: undefined reference to `l4vfs_init_connection' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.socket+0xc):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:673: undefined reference to `ft_get_next_free_entry' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.socket+0xa3):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:679: undefined reference to `ft_fill_entry' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.bind+0x20):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:684: undefined reference to `ft_is_open' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.bind+0x33):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:690: undefined reference to `ft_get_entry' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.recvfrom+0x3a):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:690: undefined reference to `ft_is_open' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.recvfrom+0x4d):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:692: undefined reference to `ft_get_entry' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.sendto+0x30):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:690: undefined reference to `ft_is_open' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.sendto+0x43):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:692: undefined reference to `ft_get_entry' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.setsockopt+0x24):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:684: undefined reference to `ft_is_open' ../../../../../lib/x86_586/l4v2/libdiet_be_socket_io.a(socket.o)(.text.setsockopt+0x37):/home/tiago/l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c:690: undefined reference to `ft_get_entry' ../../../../../lib/x86_586/l4v2/libl4env.a(startup.o)(.text+0x19): In function `__startup_main': /home/tiago/l4/pkg/l4env/lib/src/startup.c:62: undefined reference to `main' ../../../../../../oskit10/lib/liboskit_kern.a(base_console_init.o)(.text+0x31c): In function `base_console_init': /home/tiago/oskit10/kern/../kern/x86/pc/base_console_init.c:220: undefined reference to `main' collect2: ld returned 1 exit status make[1]: ** [failuredetector] Erro 1 make[1]: Saindo do diretório `/home/tiago/l4/pkg/failuredetector/server/src/OBJ-x86_586-l4v2' make: ** [OBJ-x86_586-l4v2] Erro 2
But when i build the mini_http example it gives no errors and links some extra libraries that i don't see them defined in any file...
My questions are:
what am i doing wrong :) ? what extra libraries should i link and how?
by the way... following my last email, to how to add extra NIC drivers to FLIPS, it is as simple as said and worked. Just add your drivers the referenced Makefile line and extra modules needed by the driver, in my case crc32 and mii.
thanks in advance
Tiago Jorge
On Mon, Mar 07, 2005 at 11:26:30AM +0000, Tiago Jorge wrote:
Hello... As i said in earlier emails, i'm building a L4 server that needs network support. For that purpose, i'm trying to use the libraries from the FLIPS package, using as guideline the mini_http server. i've build my own package and costumized the Makefile to suit my needs. I've changed the mode to l4env_freebsd because i'm using C++ + STL, and i need the headers and the libstdc++.a. I've changed also the needed extra libraries as in the mini_http example. So the Makefile looks like this: [...] My questions are:
what am i doing wrong :) ? what extra libraries should i link and how?
AFAIK L4Env with OSKit's FreeBSD libc does not work with L4VFS and libc_backends. If you want to stay with the current FLIPS client library you have to use dielibc.
by the way... following my last email, to how to add extra NIC drivers to FLIPS, it is as simple as said and worked. Just add your drivers the referenced Makefile line and extra modules needed by the driver, in my case crc32 and mii.
That sounds good :-)
Chao
Christian Helmuth wrote:
AFAIK L4Env with OSKit's FreeBSD libc does not work with L4VFS and libc_backends. If you want to stay with the current FLIPS client library you have to use dielibc.
Once again thank you for your prompt answers. I'm having a "little" problem again. Like i said before i'm porting a C++ aplication. In these program, i use STL (vectors and maps mostly). So that i can use the l4env_base and c++, i've built a costum mode, WOO_mode:
############################################################################## # # x86_WOO_mode - custom mode # ISTO É MEU #
BID_SUPPORTED_x86_WOO_mode = y LIBCINCDIR_x86_WOO_mode = -nostdinc -I$(L4DIR)/include/dietlibc \ -I$(DROPS_STDDIR)/include/dietlibc \ -I$(L4DIR)/include/c++/$(GCCVERSION) \ -I$(L4DIR)/include/c++/$(GCCVERSION)/drops \
-I$(DROPS_STDDIR)/include/c++/$(GCCVERSION) \ -I$(DROPS_STDDIR)/include/c++/$(GCCVERSION)/drops \ -I$(GCCINCDIR) \
LIBCLIBDIR_x86_WOO_mode = -L$(L4DIR)/lib/c++/$(GCCVERSION) \ -L$(DROPS_STDDIR)/lib/c++/$(GCCVERSION)
LIBCLIBS_x86_WOO_mode = -nostdlib $(GCCLDNOSTDLIB) \ -u printf -ldiet_be_io.o -l$(DIETLIBC_MALLOC_BACKEND) \ -ldiet_be_time -lrtc \ -ll4rm -ldm_mem -ldm_generic -lthread -lsemaphore \ -ll4env -ll4env_err -lslab -llogserver_capsule -ll4rm \ -lthread -ldm_generic -lnames -ll4util -lrmgr \ -ldiet_c $(GCCLIB) -ldiet_c \ -ldiet_be_time -ldiet_be_mmap -ldiet_be_mmap_util.o \ -ldiet_be_l4env_start_stop -lgeneric_ts -ldiet_be_syslog \ -ldiet_be_file-table -ldiet_be_simple_sleep \ -ll4vfs_common_io -ll4vfs_basic_io -ll4vfs_connection \ -ll4vfs_basic_name_server -ll4vfs_name_server \ -ll4vfs_name_space_provider -ll4vfs_extendable
L4LIBS_x86_WOO_mode = -static -ll4rm -ldm_mem -ldm_generic -lthread \ -lsemaphore -ll4env -ll4env_err -lslab \ -llogserver_capsule -ll4rm \ -lthread -ldm_generic -lnames \ -ll4util -lrmgr CRT0_x86_WOO_mode = $(call findfile,crt0.o,$(L4LIBDIR)) CRTN_x86_WOO_mode = LDSCRIPT_x86_WOO_mode = $(call findfile,main_stat.ld,$(L4LIBDIR))
####################################################################################
and i have included in the Makefile the libstdc++. But the error that gives me its tipical of the STL need of exceptions i think. An excerpt follows:
[...]
/home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/src/ios.cc:335: undefined reference to `_Unwind_Resume' ../../../../../lib/c++/3.3/libstdc++.a(istream-inst.o)(.gnu.linkonce.t._ZNSiC2EPSt15basic_streambufIcSt11char_traitsIcEE+0x45):/home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/include/bits/basic_ios.h:107: more undefined references to `_Unwind_Resume' follow ../../../../../lib/c++/3.3/libstdc++.a(pure.o)(.text+0x2): In function `__cxa_pure_virtual': /home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/libsupc++/pure.cc:49: undefined reference to `__sF' ../../../../../lib/c++/3.3/libstdc++.a(ctype.o)(.text+0x33c): In function `std::ctype<char>::~ctype [not-in-charge]()': /home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/include/bits/locale_facets.h:127: undefined reference to `_Unwind_Resume' ../../../../../lib/c++/3.3/libstdc++.a(ctype.o)(.text+0x3ac): In function `std::ctype<char>::~ctype [in-charge]()': /home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/include/bits/locale_facets.h:127: undefined reference to `_Unwind_Resume' ../../../../../lib/c++/3.3/libstdc++.a(ctype.o)(.text+0x424): In function `std::ctype<char>::~ctype [in-charge deleting]()': /home/tiago/l4/pkg/libstdc++/lib/src-v3/dist/drops/libstdc++-v3/include/bits/locale_facets.h:127: undefined reference to `_Unwind_Resume'
[...]
After a search in the best work tool ever (aka Google) the method _Unwind_Resume has to do with exception propagation. But as we know, only the l4env_freebsd and oskit10_sigma0 mode have full support for C++ exceptions. But the FLIPS server has to be used with dielibc.
My question is... is there any way to link with dielibc and still use C++ and exceptions?
thanks in advance and thank you for your patience...
Tiago Jorge
Tiago Jorge wrote:
<...>
After a search in the best work tool ever (aka Google) the method _Unwind_Resume has to do with exception propagation. But as we know, only the l4env_freebsd and oskit10_sigma0 mode have full support for C++ exceptions. But the FLIPS server has to be used with dielibc.
My question is... is there any way to link with dielibc and still use C++ and exceptions?
Well, you could try to "port" all the dietlibc backends to be used with another libc, *maybe* a recompile with the other libc is sufficient (currently they are all compiled with against the dietlibc).
However, you will be walking an unpaved road ...
If you make progress with this, please give us feedback!
Another way would be to split your application into two part connected with some (libc independent) interface and build one part in c++ with the oskit libc and the other in c with dietlibc.
Greets & good luck, Martin
Well, you could try to "port" all the dietlibc backends to be used with another libc, *maybe* a recompile with the other libc is sufficient (currently they are all compiled with against the dietlibc).
Hello... Following your advice, i think i'm gonna lose two or three days trying to port the dietlibc backends. I went to the dir l4/pkg/l4vfs/lib/libc_backends/ and tried to recompile it with the l4env_freebsd mode. It all went well with file_table and select. In file_table and select i've changed the Makefile to l4env_freebsd and changed these line to: CFLAGS = -ffunction-sections -I/home/tiago/l4/include.
First thing: i'm don't no if i'm doing this right and what do you mean when you say "port" to another libc, because i don't know what are the specific parts that use the dielibc. if you could give me some guidelines, i would be very thankfull.
In the other hand, when i try to do similar procedure in io and socket_io it gives me some problems, for example, when i add the l4env_freebsd mode and the path to libgen.h it give me the following:
... Compiling operations.o LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=operations.o GENDEP_BINARY=cc1 gcc -c -DRAM_BASE=0x0 -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2 -I../../../../idl/OBJ-x86-l4v2 -I../../../../../../include/x86/l4v2 -I/home/tiago/drops/include/x86/l4v2 -I../../../../../../include/l4v2 -I/home/tiago/drops/include/l4v2 -I../../../../../../include/x86 -I/home/tiago/drops/include/x86 -I../../../../../../include -I/home/tiago/drops/include -nostdinc -DOSKIT -I../../../../../../../oskit10/freebsd/libc/include -I../../../../../../../oskit10/freebsd/3.x/src/include -I../../../../../../../oskit10/freebsd/3.x/src/sys -I../../../../../../../oskit10 -I../../../../../../include/c++/3.3 -I../../../../../../include/c++/3.3/drops -I/home/tiago/drops/include/oskit10 -I/home/tiago/drops/include/oskit10/oskit/freebsd -I/home/tiago/drops/include/c++/3.3 -I/home/tiago/drops/include/c++/3.3/drops -I/usr/lib/gcc-lib/i486-linux/3.3.4/include -ffunction-sections -I../../../../../../include/dietlibc -gstabs+ -g -O2 -fno-strict-aliasing -march=i586 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations /home/tiago/l4/pkg/l4vfs/lib/libc_backends/io/operations.c -o operations.o In file included from /home/tiago/l4/pkg/l4vfs/lib/libc_backends/io/operations.c:18: ../../../../../../include/dietlibc/libgen.h:8: error: parse error before "__THROW" ../../../../../../include/dietlibc/libgen.h:8: warning: type defaults to `int' in declaration of `__THROW' ../../../../../../include/dietlibc/libgen.h:8: warning: data definition has no type or storage class ../../../../../../include/dietlibc/libgen.h:9: error: parse error before "__THROW" ../../../../../../include/dietlibc/libgen.h:9: warning: type defaults to `int' in declaration of `__THROW' ../../../../../../include/dietlibc/libgen.h:9: warning: data definition has no type or storage class
thanks in advance
Tiago
Tiago Jorge wrote:
Well, you could try to "port" all the dietlibc backends to be used with another libc, *maybe* a recompile with the other libc is sufficient (currently they are all compiled with against the dietlibc).
Hello... Following your advice, i think i'm gonna lose two or three days trying to port the dietlibc backends. I went to the dir l4/pkg/l4vfs/lib/libc_backends/ and tried to recompile it with the l4env_freebsd mode. It all went well with file_table and select. In file_table and select i've changed the Makefile to l4env_freebsd and changed these line to: CFLAGS = -ffunction-sections -I/home/tiago/l4/include.
First thing: i'm don't no if i'm doing this right and what do you mean when you say "port" to another libc, because i don't know what are the specific parts that use the dielibc.
Well, by "port" I mean fixing problems like the ones below ... There should not be much dietlibc specific stuff, but constants like O_RDONLY make trouble sometimes as they should be the same everywhere (clients and servers) and oskit has an own idea about this sometimes ...
if you could give me some guidelines, i would be very thankfull.
Please do not expect to much here as this is currently no main project here.
Basically you should check all the libs in l4vfs and libc_backends_l4vfs.
In the other hand, when i try to do similar procedure in io and socket_io it gives me some problems, for example, when i add the l4env_freebsd mode and the path to libgen.h it give me the following:
... Compiling operations.o LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=operations.o GENDEP_BINARY=cc1 gcc -c -DRAM_BASE=0x0 -DSYSTEM_x86_586_l4v2 -DARCH_x86 -DCPUTYPE_586 -DL4API_l4v2 -I../../../../idl/OBJ-x86-l4v2 -I../../../../../../include/x86/l4v2 -I/home/tiago/drops/include/x86/l4v2 -I../../../../../../include/l4v2 -I/home/tiago/drops/include/l4v2 -I../../../../../../include/x86 -I/home/tiago/drops/include/x86 -I../../../../../../include -I/home/tiago/drops/include -nostdinc -DOSKIT -I../../../../../../../oskit10/freebsd/libc/include -I../../../../../../../oskit10/freebsd/3.x/src/include -I../../../../../../../oskit10/freebsd/3.x/src/sys -I../../../../../../../oskit10 -I../../../../../../include/c++/3.3 -I../../../../../../include/c++/3.3/drops -I/home/tiago/drops/include/oskit10 -I/home/tiago/drops/include/oskit10/oskit/freebsd -I/home/tiago/drops/include/c++/3.3 -I/home/tiago/drops/include/c++/3.3/drops -I/usr/lib/gcc-lib/i486-linux/3.3.4/include -ffunction-sections -I../../../../../../include/dietlibc -gstabs+ -g -O2
Looks like you mixed oskit and dietlibc headers, probably not such a good idea. Stick to one libc or "know what you are doing".
Greets, Martin
Hi Tiago,
<...>
But when i build the mini_http example it gives no errors and links some extra libraries that i don't see them defined in any file...
-> l4/mk/modes.inc
My questions are:
what am i doing wrong :) ? what extra libraries should i link and how?
You should link more libs. Look into l4/mk/modes.inc for ideas. There are many libs specified there, which you did not mention (e.g. `ft_get_next_free_entry' is defined in 'libdiet_be_file-table').
I'm not sure however, if the mixture between these 'dietlibc backends', c++, and the bsd-libc will work correctly ...
Greets, Martin
l4-hackers@os.inf.tu-dresden.de