hello again... Could somebody tell me if to use C++ custoum templates i must use the stdlibc++?
thanks in advance
Tiago J.
Tiago,
On Tuesday 15 March 2005 12:33, Tiago Jorge wrote:
Could somebody tell me if to use C++ custoum templates i must use the stdlibc++?
As far as I know C++ templates do not need any support from the stdlibc++. Just make sure that you compile your C++ code with -fno-rtti and -fno-exceptions.
Frank
Frank Mehnert wrote:
Tiago,
On Tuesday 15 March 2005 12:33, Tiago Jorge wrote:
Could somebody tell me if to use C++ custoum templates i must use the stdlibc++?
As far as I know C++ templates do not need any support from the stdlibc++. Just make sure that you compile your C++ code with -fno-rtti and -fno-exceptions.
Frank
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
thank you again for your prompt answer... I already compile with those flags. My problem is the following:
because i'm using the dielibc i can't use STL, because it launches exceptions. So, i've made my own templates of vector and map without exceptions and i'm trying to use them. the error is the following:
FailureDetector.o(.eh_frame+0x11): In function `map<int, heartbeat>::del(int)': /home/tiago/l4/pkg/failuredetector/server/src/WOO_map.h: undefined reference to `__gxx_personality_v0' main.o(.eh_frame+0x11): In function `main': /home/tiago/l4/pkg/failuredetector/server/src/WOO_vector.h:20: undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
by the way, line 20 is the constructor and it doesn't throws exceptions. So here i am stuck at this point :(
thanks again
Tiago Jorge
On Tuesday 15 March 2005 13:34, Tiago Jorge wrote:
I already compile with those flags. My problem is the following:
Are you _sure_ that your _whole_ C++ code is compiled with -fno-exceptions?
because i'm using the dielibc i can't use STL, because it launches exceptions. So, i've made my own templates of vector and map without exceptions and i'm trying to use them. the error is the following:
FailureDetector.o(.eh_frame+0x11): In function `map<int, heartbeat>::del(int)': /home/tiago/l4/pkg/failuredetector/server/src/WOO_map.h: undefined reference to `__gxx_personality_v0' main.o(.eh_frame+0x11): In function `main': /home/tiago/l4/pkg/failuredetector/server/src/WOO_vector.h:20: undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
This function is called when unwinding the stack due to an exception.
by the way, line 20 is the constructor and it doesn't throws exceptions. So here i am stuck at this point :(
We are using templates in the Fiasco microkernel -- without any problems (and without exceptions).
Frank
On Tuesday 15 March 2005 14:02, Frank Mehnert wrote:
On Tuesday 15 March 2005 13:34, Tiago Jorge wrote:
I already compile with those flags. My problem is the following:
Are you _sure_ that your _whole_ C++ code is compiled with -fno-exceptions?
because i'm using the dielibc i can't use STL, because it launches exceptions. So, i've made my own templates of vector and map without exceptions and i'm trying to use them. the error is the following:
FailureDetector.o(.eh_frame+0x11): In function `map<int, heartbeat>::del(int)': /home/tiago/l4/pkg/failuredetector/server/src/WOO_map.h: undefined reference to `__gxx_personality_v0' main.o(.eh_frame+0x11): In function `main': /home/tiago/l4/pkg/failuredetector/server/src/WOO_vector.h:20: undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
This function is called when unwinding the stack due to an exception.
by the way, line 20 is the constructor and it doesn't throws exceptions. So here i am stuck at this point :(
We are using templates in the Fiasco microkernel -- without any problems (and without exceptions).
An other point: Do you use gcc or g++ to compile your C++ code? Try g++. (Thanx Ron for pointing this out).
Frank
On Tuesday 15 March 2005 14:02, Frank Mehnert wrote:
On Tuesday 15 March 2005 13:34, Tiago Jorge wrote:
I already compile with those flags. My problem is the following:
Are you _sure_ that your _whole_ C++ code is compiled with -fno-exceptions?
because i'm using the dielibc i can't use STL, because it launches exceptions. So, i've made my own templates of vector and map without exceptions and i'm trying to use them. the error is the following:
FailureDetector.o(.eh_frame+0x11): In function `map<int, heartbeat>::del(int)': /home/tiago/l4/pkg/failuredetector/server/src/WOO_map.h: undefined reference to `__gxx_personality_v0' main.o(.eh_frame+0x11): In function `main': /home/tiago/l4/pkg/failuredetector/server/src/WOO_vector.h:20: undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
This function is called when unwinding the stack due to an exception.
by the way, line 20 is the constructor and it doesn't throws exceptions. So here i am stuck at this point :(
We are using templates in the Fiasco microkernel -- without any problems (and without exceptions).
An other point: Do you use gcc or g++ to compile your C++ code? Try g++. (Thanx Ron for pointing this out).
Frank
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
ok... i'm __compiling__ with g++, but __linking__ with gcc, because i'm using the BID. another point, in the Makefile to pass those parameters i put them in the CXX_FLAGS variable but they don't seem to appear in the compiling line. it's here:
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 -I../../../../../include/dietlibc -I/home/tiago/drops/include/dietlibc -I../../../../../include/c++/3.3 -I../../../../../include/c++/3.3/drops -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
and the link its here:
LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=failuredetector GENDEP_BINARY=ld gcc -o failuredetector ../../../../../lib/x86_586/crt0.o exc.o FailureDetector.o main.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../../../../../lib/c++/3.3 -L/home/tiago/drops/lib/c++/3.3 -L/home/tiago/drops/lib/oskit10 -T../../../../../lib/x86_586/main_stat.ld /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 -ll4rm -ldm_mem -ldm_generic -lthread -lsemaphore -ll4env -ll4env_err -lslab -llogserver_capsule -ll4rm -lthread -ldm_generic -lnames -ll4util -lrmgr -nostdlib -Wl,--nostdlib -u printf -ldiet_be_io.o -ldiet_be_simple_mem.o -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 /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a -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 -Ttext=0x01d00000 -Wl,-gc-sections
like you have said, without knowing i'm not compiling with those flags, but i don't know the reason beacause its in the Makefile:
CXX_FLAGS = -nostdinc++ -fno-rtti -fno-exceptions
thanks
Tiago
On Tuesday 15 March 2005 14:24, Tiago Jorge wrote:
ok... i'm __compiling__ with g++, but __linking__ with gcc, because i'm using the BID. another point, in the Makefile to pass those parameters i put them in the CXX_FLAGS variable but they don't seem to appear in the compiling line. it's here:
Use CXXFLAGS!
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 -I../../../../../include/dietlibc -I/home/tiago/drops/include/dietlibc -I../../../../../include/c++/3.3 -I../../../../../include/c++/3.3/drops -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
and the link its here:
LD_PRELOAD=/home/tiago/l4/tool/gendep/libgendep.so GENDEP_TARGET=failuredetector GENDEP_BINARY=ld gcc -o failuredetector ../../../../../lib/x86_586/crt0.o exc.o FailureDetector.o main.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../../../../../lib/c++/3.3 -L/home/tiago/drops/lib/c++/3.3 -L/home/tiago/drops/lib/oskit10 -T../../../../../lib/x86_586/main_stat.ld /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 -ll4rm -ldm_mem -ldm_generic -lthread -lsemaphore -ll4env -ll4env_err -lslab -llogserver_capsule -ll4rm -lthread -ldm_generic -lnames -ll4util -lrmgr -nostdlib -Wl,--nostdlib -u printf -ldiet_be_io.o -ldiet_be_simple_mem.o -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 /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a -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 -Ttext=0x01d00000 -Wl,-gc-sections
like you have said, without knowing i'm not compiling with those flags, but i don't know the reason beacause its in the Makefile:
CXX_FLAGS = -nostdinc++ -fno-rtti -fno-exceptions
Use CXXFLAGS. (See l4/mk/binary.inc)
Frank
Templates almost universally rely on exceptions, because operator new is specified as allowed to throw an exception. Regrettably, support for that is in stdlibc++.
On Tue, 2005-03-15 at 13:03 +0100, Frank Mehnert wrote:
Tiago,
On Tuesday 15 March 2005 12:33, Tiago Jorge wrote:
Could somebody tell me if to use C++ custoum templates i must use the stdlibc++?
As far as I know C++ templates do not need any support from the stdlibc++. Just make sure that you compile your C++ code with -fno-rtti and -fno-exceptions.
Frank _______________________________________________ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Jonathan S. Shapiro wrote:
Templates almost universally rely on exceptions, because operator new is specified as allowed to throw an exception. Regrettably, support for that is in stdlibc++.
I can't find where the use of templates would imply the use or require the existence of the new operator. We happily (ab)use templates in L4Ka::Pistachio without any new operator or support for C++ exceptions.
Uwe
Templates almost universally rely on exceptions, because operator new is specified as allowed to throw an exception. Regrettably, support for that is in stdlibc++.
I can't find where the use of templates would imply the use or require the existence of the new operator. We happily (ab)use templates in L4Ka::Pistachio without any new operator or support for C++ exceptions.
Uwe
sure... it works now... when i say templates i'm referring to a template made by me... not the templates from the STL. Those use on exceptions from the beggining, and because i use dielibc, i can't use them
Tiago
l4-hackers@os.inf.tu-dresden.de