r1823 - in trunk

dslinux_amadeus at dslinux.in-berlin.de dslinux_amadeus at dslinux.in-berlin.de
Thu Jul 19 01:04:07 CEST 2007


Author: amadeus
Date: 2007-07-19 01:04:02 +0200 (Thu, 19 Jul 2007)
New Revision: 1823

Log:
Enable uClibc++

Modified: trunk/config/Configure.help
===================================================================
--- trunk/config/Configure.help	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/config/Configure.help	2007-07-18 23:04:02 UTC (rev 1823)
@@ -808,6 +808,11 @@
   Only enable this if you want to force the library to be built.  The
   Config will make sure this library is built if it is needed.
 
+CONFIG_LIB_UCLIBCPP_FORCE
+  Enable embedded C++ standard library.
+  Only enable this if you want to force the library to be built.  The
+  Config will make sure this library is built if it is needed.
+
 CONFIG_USER_BOA_EMERG
   If enabled, boa will syslog all messages at the emergency level
 

Modified: trunk/config/config.in
===================================================================
--- trunk/config/config.in	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/config/config.in	2007-07-18 23:04:02 UTC (rev 1823)
@@ -116,6 +116,7 @@
 bool 'Build libcrypt_old'	CONFIG_LIB_LIBCRYPT_OLD_FORCE
 bool 'Build libid3tag'		CONFIG_LIB_ID3TAG_FORCE
 bool 'Build libmad'		CONFIG_LIB_MAD_FORCE
+bool 'Build uClibc++'		CONFIG_LIB_UCLIBCPP_FORCE
 
 comment 'Library Configuration'
 bool 'Support time zones'	CONFIG_LIB_UC_LIBC_TIMEZONE
@@ -1739,6 +1740,10 @@
 comment "Debug tools"
 bool 'tpt'				CONFIG_USER_TIMEPEG_TPT
 bool 'rtest'				CONFIG_USER_RTEST
+    if [ "$CONFIG_USER_RTEST" = "y" ]; then
+        define_bool CONFIG_LIB_UCLIBCPP y
+    fi
+
 comment "Debug libraries"
 bool 'ccmalloc'				CONFIG_LIB_LIBCCMALLOC
 

Modified: trunk/include/Makefile
===================================================================
--- trunk/include/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/include/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -60,9 +60,9 @@
 	$(ROOTDIR)/prop/smgrd/unixware/cmd/sscep/sscep_error_codes.h,. \
 	$(ROOTDIR)/lib/libid3tag/id3tag.h,. \
 	$(ROOTDIR)/lib/libmad/mad.h,. \
-	$(ROOTDIR)/lib/gpm/src/headers/gpm.h,.
+	$(ROOTDIR)/lib/gpm/src/headers/gpm.h,. \
+	$(ROOTDIR)/lib/uClibc++/include/*,uClibc++
 
-
 #
 # Both freeswan and openswan can provide des and crypto headers
 # and we need to make sure we are using the correct ones.
@@ -104,12 +104,12 @@
 	done
 	@rm -f gcc
 	@ln -s `$(CC) -print-file-name=include` gcc
-	@echo "Making include/c++ symlink to compiler c++ includes"
-	@rm -f c++
-	@ln -s /usr/local/include/g++-v3 c++
-	@for i in `$(CXX) -v -xc++ /dev/null 2>&1 | sed -e '/^Reading specs/,/^#include <\.\.\.>/d' -e '/End of search list/Q'`; do \
-		if [ -f $$i/new ]; then rm -f c++; ln -s $$i c++; break; fi; \
-	done
+#	@echo "Making include/c++ symlink to compiler c++ includes"
+#	@rm -f c++
+#	@ln -s /usr/local/include/g++-v3 c++
+#	@for i in `$(CXX) -v -xc++ /dev/null 2>&1 | sed -e '/^Reading specs/,/^#include <\.\.\.>/d' -e '/End of search list/Q'`; do \
+#		if [ -f $$i/new ]; then rm -f c++; ln -s $$i c++; break; fi; \
+#	done
 
 romfs:
 

Modified: trunk/lib/Makefile
===================================================================
--- trunk/lib/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -92,8 +92,9 @@
 dir_$(CONFIG_LIB_ID3TAG_FORCE)	+= libid3tag
 dir_$(CONFIG_LIB_MAD)		+= libmad
 dir_$(CONFIG_LIB_MAD_FORCE)	+= libmad
+dir_$(CONFIG_LIB_UCLIBCPP)	+= uClibc++
+dir_$(CONFIG_LIB_UCLIBCPP_FORCE)+= uClibc++
 
-
 # And build libraries in the prop directory last
 dir_y += $(ROOTDIR)/prop
 
@@ -176,8 +177,10 @@
 	$(ROOTDIR)/lib/libgmp/*.a  \
 	$(ROOTDIR)/lib/libid3tag/*.a \
 	$(ROOTDIR)/lib/libmad/*.a \
-	$(ROOTDIR)/lib/gpm/src/lib/*.a
+	$(ROOTDIR)/lib/gpm/src/lib/*.a \
+	$(ROOTDIR)/lib/uClibc++/src/*.a
 
+
 ##############################################################################
 
 make_links: clean_links

Modified: trunk/lib/uClibc++/Makefile
===================================================================
--- trunk/lib/uClibc++/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/uClibc++/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -1,5 +1,5 @@
 MAKE    = make
-SUBDIRS = bin include src
+SUBDIRS = include src
 
 # User defines:
 
@@ -10,11 +10,13 @@
 TOPDIR=./
 include $(TOPDIR)Rules.mak
 
-all: headers
+all: dslinuxconfig headers
 	for dir in $(SUBDIRS) ; do \
 		$(MAKE) -C $$dir all; \
 	done
 
+romfs:
+
 tests: all
 	$(MAKE) -C tests all
 
@@ -25,13 +27,11 @@
 	for dir in $(SUBDIRS) tests ; do \
 		$(MAKE) -C $$dir clean; \
 	done
-	#$(MAKE) -C extra/locale clean
-
-distclean: clean
-	$(MAKE) -C extra clean
 	$(RM) .config .config.cmd .config.old
 	$(RM) include/system_configuration.h
 
+distclean: clean
+
 headers: include/system_configuration.h
 
 install:
@@ -48,6 +48,11 @@
 extra/config/mconf:
 	make -C extra/config ncurses mconf
 
+.PHONY: dslinuxconfig
+dslinuxconfig:  extra/config/conf
+	cp -a extra/Configs/dslinux_config .config
+	@./extra/config/conf -o extra/Configs/Config.in
+
 menuconfig: extra/config/mconf
 	@./extra/config/mconf extra/Configs/Config.in
 

Modified: trunk/lib/uClibc++/Rules.mak
===================================================================
--- trunk/lib/uClibc++/Rules.mak	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/uClibc++/Rules.mak	2007-07-18 23:04:02 UTC (rev 1823)
@@ -24,13 +24,14 @@
 ifndef CROSS
 CROSS=
 endif
-CC= $(CROSS)gcc
-CXX= $(CROSS)g++
-AR= $(CROSS)ar
-LD= $(CROSS)ld
+#use the UCLINUX defines
+#CC= $(CROSS)gcc
+#CXX= $(CROSS)g++
+#AR= $(CROSS)ar
+#LD= $(CROSS)ld
 NM= $(CROSS)nm
-RANLIB= $(CROSS)ranlib
-STRIPTOOL= $(CROSS)strip
+#RANLIB= $(CROSS)ranlib
+#STRIPTOOL= $(CROSS)strip
 
 INSTALL= install
 LN= ln -s -f
@@ -100,9 +101,9 @@
 
 # Some nice CFLAGS to work with
 GEN_CFLAGS:=-fno-builtin
-CFLAGS:=$(XWARNINGS) $(CPU_CFLAGS) -ansi
+CFLAGS+=$(XWARNINGS) $(CPU_CFLAGS) -ansi
 
-LDFLAGS:=-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs
+LDFLAGS+=-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs
 
 ifeq ($(DODEBUG),y)
     CFLAGS += -O0 -g3 
@@ -122,9 +123,9 @@
 
 GEN_CXXFLAGS:=-nostdinc++
 GEN_CXXFLAGS+=$(call check_gxx_visibility)
-CXXFLAGS:=$(CFLAGS)
+# CXXFLAGS:=$(CFLAGS)
 
-LIBGCC:=$(shell $(CC) -print-libgcc-file-name)
+LIBGCC:=$(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
 LIBGCC_DIR:=$(dir $(LIBGCC))
 
 #GCC_VERSION?=$(shell $(CC) -dumpversion | cut -c1-3)

Modified: trunk/lib/uClibc++/bin/Makefile
===================================================================
--- trunk/lib/uClibc++/bin/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/uClibc++/bin/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -45,5 +45,5 @@
 ifeq ($(DODEBUG),y)
 	echo 'echo $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR $$WRAPPER_OPTIONS' >> $(WRAPPER)
 endif
-	echo 'exec $(CXX) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR $$WRAPPER_OPTIONS' >> $(WRAPPER)
+	echo 'exec $(CXX) $(CXXFLAGS) $(GEN_CFLAGS) $(GEN_CXXFLAGS) $(EH_CXXFLAGS) $$WRAPPER_INCLUDEDIR $$WRAPPER_OPTIONS' >> $(WRAPPER)
 	chmod 755 $(WRAPPER)

Modified: trunk/lib/uClibc++/src/Makefile
===================================================================
--- trunk/lib/uClibc++/src/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/uClibc++/src/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -1,7 +1,8 @@
 TOPDIR=../
 include $(TOPDIR)Rules.mak
 
-WR_CXX := WRAPPER_INCLUDEDIR=-I$(TOPDIR)include $(TOPDIR)bin/g++-uc
+# WR_CXX := WRAPPER_INCLUDEDIR=-I$(TOPDIR)include $(TOPDIR)bin/g++-uc
+WR_CXX := $(CXX)
 
 LDFLAGS += -nodefaultlibs -shared -Wl,-soname,$(SHARED_MAJORNAME) `echo $(BUILD_EXTRA_LIBRARIES)`
 ifneq ($(DODEBUG),y)

Modified: trunk/lib/uClibc++/src/abi/libgcc_eh/Makefile
===================================================================
--- trunk/lib/uClibc++/src/abi/libgcc_eh/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/lib/uClibc++/src/abi/libgcc_eh/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -16,7 +16,7 @@
 #
 #else
 #	echo Binary
-	$(AR) x $(shell $(CC) -print-file-name=libgcc_eh.a)
+	$(AR) x $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) $@
 #endif
 #endif
 

Modified: trunk/tools/ucfront/ucfront.c
===================================================================
--- trunk/tools/ucfront/ucfront.c	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/tools/ucfront/ucfront.c	2007-07-18 23:04:02 UTC (rev 1823)
@@ -659,9 +659,9 @@
 				args_add(stripped_args, "-lc");
 				args_add(stripped_args, "-lgcc");
 				/* support c++ */
-				args_add(stripped_args, "-lstdc++");
-				args_add(stripped_args, "-lsupc++");
-				args_add(stripped_args, "-lm");
+				// args_add(stripped_args, "-lstdc++");
+				// args_add(stripped_args, "-lsupc++");
+				// args_add(stripped_args, "-lm");
 				args_add(stripped_args, "-Wl,--end-group");
 			}
 		}

Modified: trunk/user/rtest/Makefile
===================================================================
--- trunk/user/rtest/Makefile	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/user/rtest/Makefile	2007-07-18 23:04:02 UTC (rev 1823)
@@ -28,8 +28,8 @@
 
 # This is the rule that build the executable.
 $(EXEC): $(OBJS)
-	$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
-	arm-linux-elf-flthdr -k $(EXEC) 
+	$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(CXXLIBS) $(LDLIBS)
+	arm-linux-elf-flthdr -s 100000 -K $(EXEC) 
 
 # The romfs target is also phony. It is used to copy your app
 # into the DSLinux filesystem image.

Modified: trunk/user/rtest/rtest.cxx
===================================================================
--- trunk/user/rtest/rtest.cxx	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/user/rtest/rtest.cxx	2007-07-18 23:04:02 UTC (rev 1823)
@@ -4,9 +4,12 @@
 class test1 {
 public:
 test1();
-virtual ~test1();
+~test1();
 
 virtual const char *self(void);
+virtual const char *selfa(void);
+virtual const char *selfb(void);
+virtual const char *selfc(void);
 
 };
 
@@ -22,6 +25,19 @@
 	return "test 1";
 }
 
+const char *test1::selfa(void) {
+	return "test 1a";
+}
+
+const char *test1::selfb(void) {
+	return "test 1b";
+}
+
+const char *test1::selfc(void) {
+	return "test 1c";
+}
+
+/*
 class test2: public test1 {
 public:
 test2();
@@ -42,19 +58,30 @@
 const char *test2::self(void) {
 	return "test 2";
 }
+*/
 
 
-
 int main()
  {
 	test1 *bubi;
+//	unsigned int *x;
 
 	puts("start: before new\n");
 
 	bubi = new test1;
 
-	puts("after new\n");
+//	puts("after new\n");
 
+	/* get address of object */
+//	x = (unsigned int *) bubi;
+//	printf("%X\n ", x[0]);
+
+	// get vtable contents
+//	x = (unsigned int *) x[0];
+//	printf("%X ", x[0]);
+//	printf("%X ", x[1]);
+//	printf("%X\n ", x[2]);
+
 	puts( bubi->self());
 
 	delete bubi;

Modified: trunk/vendors/Nintendo/DLDI/config.vendor
===================================================================
--- trunk/vendors/Nintendo/DLDI/config.vendor	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/vendors/Nintendo/DLDI/config.vendor	2007-07-18 23:04:02 UTC (rev 1823)
@@ -84,6 +84,7 @@
 # CONFIG_LIB_LIBCRYPT_OLD_FORCE is not set
 # CONFIG_LIB_ID3TAG_FORCE is not set
 # CONFIG_LIB_MAD_FORCE is not set
+# CONFIG_LIB_UCLIBCPP_FORCE is not set
 
 #
 # Library Configuration
@@ -1042,7 +1043,7 @@
 # Debug tools
 #
 # CONFIG_USER_TIMEPEG_TPT is not set
-# CONFIG_USER_RTEST is not set
+CONFIG_USER_RTEST=y
 
 #
 # Debug libraries

Modified: trunk/vendors/config/armnommu/config.arch
===================================================================
--- trunk/vendors/config/armnommu/config.arch	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/vendors/config/armnommu/config.arch	2007-07-18 23:04:02 UTC (rev 1823)
@@ -165,19 +165,6 @@
 	CFLAGS  += -Dlinux -D__linux__ -Dunix
 	CFLAGS  += -D__uClinux__
 
-	CXXFLAGS = $(CFLAGS) -fno-exceptions
-
-	# C++ headers, linked into the DSLINUX source tree
-	# use -I because the c++ dirs have to come before the other system dirs.
-	CXXFLAGS += -I $(ROOTDIR)/include/c++
-	CXXFLAGS += -I $(ROOTDIR)/include/c++/arm-linux-elf
-	CXXFLAGS += -I $(ROOTDIR)/include/c++/backward
-	
-	# be compatible for old style c++ includes
-	CXXFLAGS += -Wno-deprecated
-
-	CXXSUP = 
-
 	LDFLAGS += -Wl,-elf2flt
   ifndef DISABLE_MOVE_RODATA
   	LDFLAGS += -Wl,-move-rodata
@@ -212,7 +199,26 @@
 ifeq ($(UCLINUX_BUILD_SET),1)
 	EXTRA_CFLAGS := $(CPUFLAGS)
 
-	CXXLIBS = $(LIBSTDCPP) $(CXXSUP)
+	CXXFLAGS = $(CFLAGS) -fno-exceptions
+
+	# C++ headers, linked into the DSLINUX source tree
+	# use -I because the c++ dirs have to come before the other system dirs.
+	ifdef CONFIG_LIB_UCLIBCPP
+		CXXFLAGS += -I $(UCLIBCPP_INCDIR)
+		CXXFLAGS += -fno-builtin
+		CXXFLAGS += -nostdinc++
+		CXXFLAGS += -DGCC_HASCLASSVISIBILITY
+		CXXFLAGS += -fno-rtti
+		LIBGCC:=$(shell $(CXX) $(CXXFLAGS) -print-libgcc-file-name)
+		LIBGCC_DIR:=$(dir $(LIBGCC))
+		CXXLIBS	  =  $(CXXSUP)
+		CXXLIBS	 += -luClibc++
+		CXXLIBS  += -L$(LIBGCC_DIR)
+		CXXLIBS  += -lsupc++ 
+	endif	
+
+	# be compatible for old style c++ includes
+	CXXFLAGS += -Wno-deprecated
   	 
 	LDLIBS = $(LIBBIND)
 endif

Modified: trunk/vendors/config/common/config.arch
===================================================================
--- trunk/vendors/config/common/config.arch	2007-07-17 23:44:58 UTC (rev 1822)
+++ trunk/vendors/config/common/config.arch	2007-07-18 23:04:02 UTC (rev 1823)
@@ -89,4 +89,8 @@
 	STL_INCDIR=$(ROOTDIR)/include/STLport
 	STL_LIBDIR=$(ROOTDIR)/lib/STLport/lib
 
+	# uClibc++
+	UCLIBCPP_INCDIR=$(ROOTDIR)/include/uClibc++
+	# UCLIBCPP_LIBDIR=$(ROOTDIR)/lib/uClibc++/??
+
 endif




More information about the dslinux-commit mailing list