diff options
-rw-r--r-- | misc/uClibc++/libxx/uClibc++/Make.defs | 18 | ||||
-rw-r--r-- | nuttx/arch/arm/src/Makefile | 26 | ||||
-rw-r--r-- | nuttx/arch/sim/src/Makefile | 51 | ||||
-rw-r--r-- | nuttx/configs/sim/cxxtest/Make.defs | 98 | ||||
-rw-r--r-- | nuttx/configs/sim/cxxtest/defconfig | 9 | ||||
-rw-r--r-- | nuttx/libxx/Kconfig | 11 |
6 files changed, 120 insertions, 93 deletions
diff --git a/misc/uClibc++/libxx/uClibc++/Make.defs b/misc/uClibc++/libxx/uClibc++/Make.defs index cf69adebe..2a877ee3e 100644 --- a/misc/uClibc++/libxx/uClibc++/Make.defs +++ b/misc/uClibc++/libxx/uClibc++/Make.defs @@ -37,13 +37,17 @@ CXXSRCS += algorithm.cxx associative_base.cxx bitset.cxx char_traits.cxx CXXSRCS += complex.cxx del_op.cxx del_opnt.cxx del_opv.cxx del_opvnt.cxx -CXXSRCS += deque.cxx eh_alloc.cxx eh_globals.cxx eh_terminate.cxx exception.cxx -CXXSRCS += fstream.cxx func_exception.cxx iomanip.cxx ios.cxx -CXXSRCS += iostream.cxx istream.cxx iterator.cxx limits.cxx list.cxx -CXXSRCS += locale.cxx map.cxx new_handler.cxx new_op.cxx new_opnt.cxx -CXXSRCS += new_opv.cxx new_opvnt.cxx numeric.cxx ostream.cxx queue.cxx -CXXSRCS += set.cxx sstream.cxx stack.cxx stdexcept.cxx streambuf.cxx -CXXSRCS += string.cxx typeinfo.cxx utility.cxx valarray.cxx vector.cxx +CXXSRCS += deque.cxx exception.cxx fstream.cxx func_exception.cxx +CXXSRCS += iomanip.cxx ios.cxx iostream.cxx istream.cxx iterator.cxx +CXXSRCS += limits.cxx list.cxx locale.cxx map.cxx new_handler.cxx +CXXSRCS += new_op.cxx new_opnt.cxx new_opv.cxx new_opvnt.cxx numeric.cxx +CXXSRCS += ostream.cxx queue.cxx set.cxx sstream.cxx stack.cxx +CXXSRCS += stdexcept.cxx streambuf.cxx string.cxx typeinfo.cxx utility.cxx +CXXSRCS += valarray.cxx vector.cxx + +ifneq ($(CONFIG_UCLIBCXX_HAVE_LIBSUPCXX),y) +CXXSRCS += eh_alloc.cxx eh_globals.cxx eh_terminate.cxx +endif # Add the path to the uClibc++ subdirectory diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index 74be6c18d..49a651c4e 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -100,18 +100,18 @@ $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) libarch$(LIBEXT): $(OBJS) - @( for obj in $(OBJS) ; do \ + $(Q) ( for obj in $(OBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) board/libboard$(LIBEXT): - @$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) - @echo "LD: nuttx" - @$(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ + $(Q) echo "LD: nuttx" + $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group - @$(NM) $(NUTTX)$(EXEEXT) | \ + $(Q) $(NM) $(NUTTX)$(EXEEXT) | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map @@ -121,7 +121,7 @@ nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) ifneq ($(HEAD_OBJ),) - @if [ -d "$(EXPORT_DIR)/startup" ]; then \ + $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ else \ echo "$(EXPORT_DIR)/startup does not exist"; \ @@ -132,26 +132,26 @@ endif # Dependencies .depend: Makefile chip/Make.defs $(SRCS) - @if [ -e board/Makefile ]; then \ + $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ fi - @$(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ + $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) touch $@ depend: .depend clean: - @if [ -e board/Makefile ]; then \ + $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - @rm -f libarch$(LIBEXT) *~ .*.swp + $(Q) rm -f libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean - @if [ -e board/Makefile ]; then \ + $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - @rm -f Make.dep .depend + $(Q) rm -f Make.dep .depend -include Make.dep diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile index 43210e37b..cf8008b16 100644 --- a/nuttx/arch/sim/src/Makefile +++ b/nuttx/arch/sim/src/Makefile @@ -100,12 +100,17 @@ ifeq ($(CONFIG_SIM_TOUCHSCREEN),y) endif endif +EXTRA_LIBS ?= + ifeq ($(CONFIG_FS_FAT),y) STDLIBS += -lz endif STDLIBS += -lc +LIBGCC := "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}" +GCC_LIBDIR := ${shell dirname $(LIBGCC)} + # Determine which objects are required in the link. The # up_head object normally draws in all that is needed, but # there are a fews that must be included because they @@ -129,7 +134,7 @@ LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS)))) # Add the board-specific library and directory -LDPATHS += -L board +LDPATHS += -L board -L $(GCC_LIBDIR) LDLIBS += -lboard # Make targets begin here @@ -145,13 +150,13 @@ $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) $(HOSTOBJS): %$(OBJEXT): %.c - @echo "CC: $<" - @$(CC) -c $(HOSTCFLAGS) $< -o $@ + $(Q) echo "CC: $<" + $(Q) $(CC) -c $(HOSTCFLAGS) $< -o $@ # The architecture-specific library libarch$(LIBEXT): $(NUTTXOBJS) - @( for obj in $(NUTTXOBJS) ; do \ + $(Q) ( for obj in $(NUTTXOBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) @@ -160,35 +165,35 @@ libarch$(LIBEXT): $(NUTTXOBJS) # that are not hardware-related. board/libboard$(LIBEXT): - @$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) # A partially linked object containing only NuttX code (no interface to host OS) # Change the names of most symbols that conflict with libc symbols. GNU: - @mkdir ./GNU + $(Q) mkdir ./GNU GNU/Linux-names.dat: GNU nuttx-names.dat - @cp nuttx-names.dat $@ + $(Q) cp nuttx-names.dat $@ Cygwin-names.dat: nuttx-names.dat - @cat $^ | sed -e "s/^/_/g" >$@ + $(Q) cat $^ | sed -e "s/^/_/g" >$@ nuttx.rel : libarch$(LIBEXT) board/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS) - @echo "LD: nuttx.rel" - @$(LD) -r $(LDLINKFLAGS) $(LDPATHS) -o $@ $(REQUIREDOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group - @$(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@ + $(Q) echo "LD: nuttx.rel" + $(Q) $(LD) -r $(LDLINKFLAGS) $(LDPATHS) -o $@ $(REQUIREDOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group + $(Q) $(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@ # Generate the final NuttX binary by linking the host-specific objects with the NuttX # specific objects (with munged names) nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS) - @echo "LD: nuttx$(EXEEXT)" - @$(CC) $(CCLINKFLAGS) $(LDPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) - @$(NM) $(TOPDIR)/$@ | \ + $(Q) echo "LD: nuttx$(EXEEXT)" + $(Q) $(CC) $(CCLINKFLAGS) $(LDPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) + $(Q) $(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map - @rm -f nuttx.rel + $(Q) rm -f nuttx.rel # This is part of the top-level export target @@ -200,26 +205,26 @@ export_head: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS) # Dependencies .depend: Makefile $(SRCS) - @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend cleanrel: - @rm -f nuttx.rel GNU/Linux-names.dat Cygwin-names.dat + $(Q) rm -f nuttx.rel GNU/Linux-names.dat Cygwin-names.dat clean: cleanrel - @if [ -e board/Makefile ]; then \ + $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - @rm -f nuttx.rel libarch$(LIBEXT) *~ .*.swp + $(Q) rm -f nuttx.rel libarch$(LIBEXT) *~ .*.swp $(call CLEAN) distclean: clean - @if [ -e board/Makefile ]; then \ + $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi - @rm -f Make.dep .depend - @rm -rf GNU + $(Q) rm -f Make.dep .depend + $(Q) rm -rf GNU -include Make.dep diff --git a/nuttx/configs/sim/cxxtest/Make.defs b/nuttx/configs/sim/cxxtest/Make.defs index eac92e928..eba0b31dd 100644 --- a/nuttx/configs/sim/cxxtest/Make.defs +++ b/nuttx/configs/sim/cxxtest/Make.defs @@ -36,75 +36,77 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} +HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g + ARCHOPTIMIZATION = -g else - ARCHOPTIMIZATION = -O2 + ARCHOPTIMIZATION = -O2 endif -ARCHCPUFLAGS = -fno-builtin -ARCHCPUFLAGSXX = -fno-builtin -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -ARCHWARNINGSXX = -Wall -Wshadow -ARCHDEFINES = -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx -isystem $(TOPDIR)/include/uClibc++ -ARCHSCRIPT = +ARCHCPUFLAGS = -fno-builtin +ARCHCPUFLAGSXX = -fno-builtin +ARCHPICFLAGS = -fpic +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHWARNINGSXX = -Wall -Wshadow +ARCHDEFINES = +ARCHINCLUDES = -I. -isystem $(TOPDIR)/include +ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx -isystem $(TOPDIR)/include/uClibc++ +ARCHSCRIPT = ifeq ($(CONFIG_SIM_M32),y) - ARCHCPUFLAGS += -m32 - ARCHCPUFLAGSXX += -m32 + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 endif -CROSSDEV = -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump +CROSSDEV = +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ -OBJEXT = .o -LIBEXT = .a +OBJEXT = .o +LIBEXT = .a ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe + EXEEXT = .exe else - EXEEXT = + EXEEXT = endif -LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) -CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) -LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - LDLINKFLAGS += -g - CCLINKFLAGS += -g - LDFLAGS += -g + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g endif ifeq ($(CONFIG_SIM_M32),y) - LDLINKFLAGS += -melf_i386 - CCLINKFLAGS += -m32 - LDFLAGS += -m32 + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif -MKDEP = $(TOPDIR)/tools/mkdeps.sh +EXTRA_LIBS = -lsupc++ -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -HOSTLDFLAGS = +MKDEP = $(TOPDIR)/tools/mkdeps.sh + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/sim/cxxtest/defconfig b/nuttx/configs/sim/cxxtest/defconfig index 20d4e5c85..d2fef0a55 100644 --- a/nuttx/configs/sim/cxxtest/defconfig +++ b/nuttx/configs/sim/cxxtest/defconfig @@ -276,12 +276,21 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# CONFIG_HAVE_CXX=y # CONFIG_HAVE_CXXINITIALIZE is not set # CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# CONFIG_UCLIBCXX=y CONFIG_UCLIBCXX_EXCEPTION=y CONFIG_UCLIBCXX_IOSTREAM_BUFSIZE=32 +CONFIG_UCLIBCXX_HAVE_LIBSUPCXX=y # # Application Configuration diff --git a/nuttx/libxx/Kconfig b/nuttx/libxx/Kconfig index 5ce2a8f7d..8b5fc42e8 100644 --- a/nuttx/libxx/Kconfig +++ b/nuttx/libxx/Kconfig @@ -3,6 +3,8 @@ # see misc/tools/kconfig-language.txt. # +comment "Basic CXX Support" + config HAVE_CXX bool "Have C++ compiler" default n @@ -12,8 +14,6 @@ config HAVE_CXX if HAVE_CXX -comment "Basic CXX Support" - config HAVE_CXXINITIALIZE bool "Have C++ initialization" default n @@ -50,5 +50,12 @@ config UCLIBCXX_IOSTREAM_BUFSIZE int "IO Stream Buffer Size" default 32 +config UCLIBCXX_HAVE_LIBSUPCXX + bool "Have libsupc++ (required)" + default y + ---help--- + Select if your toolchain provides libsupc++. This option is required + at present because the built-in libsupc++ support is incomplete. + endif endif |