summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-04 20:29:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-04 20:29:04 +0000
commit38ef1b734afd1994804529ddbf5d28a8106f089b (patch)
tree87375c11f51bc44ebe7c45c2a92a92679f9bcd4b
parent47aad91e751825a969d01a15fb456c97d7fa398c (diff)
downloadpx4-nuttx-38ef1b734afd1994804529ddbf5d28a8106f089b.tar.gz
px4-nuttx-38ef1b734afd1994804529ddbf5d28a8106f089b.tar.bz2
px4-nuttx-38ef1b734afd1994804529ddbf5d28a8106f089b.zip
Changes to get a clean build of apps/examples/cxxtest with the STM32 and uClibc++
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5310 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--misc/uClibc++/libxx/uClibc++/Make.defs3
-rw-r--r--nuttx/configs/sim/cxxtest/Make.defs2
-rw-r--r--nuttx/configs/stm32f4discovery/README.txt29
-rw-r--r--nuttx/configs/stm32f4discovery/cxxtest/Make.defs2
-rw-r--r--nuttx/configs/twr-k60n512/scripts/ld.script2
5 files changed, 33 insertions, 5 deletions
diff --git a/misc/uClibc++/libxx/uClibc++/Make.defs b/misc/uClibc++/libxx/uClibc++/Make.defs
index 40aee6e47..cf2089f70 100644
--- a/misc/uClibc++/libxx/uClibc++/Make.defs
+++ b/misc/uClibc++/libxx/uClibc++/Make.defs
@@ -52,7 +52,8 @@ endif
# libsupc++ replacement
-# CXXSRCS += vterminate.C
+CXXSRCS += vterminate.cxx
+
ifneq ($(CONFIG_UCLIBCXX_HAVE_LIBSUPCXX),y)
CXXSRCS += eh_alloc.cxx eh_globals.cxx eh_terminate.cxx
endif
diff --git a/nuttx/configs/sim/cxxtest/Make.defs b/nuttx/configs/sim/cxxtest/Make.defs
index 6f945cc51..9c7c3d46b 100644
--- a/nuttx/configs/sim/cxxtest/Make.defs
+++ b/nuttx/configs/sim/cxxtest/Make.defs
@@ -93,7 +93,7 @@ LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
-LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a}
+LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
EXTRA_LIBS = -lsupc++
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index 730bf66ef..02fdbb07a 100644
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -1008,7 +1008,34 @@ Where <subdir> is one of the following:
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
- 3. At present (2012/11/02), this example builds only with exceptions
+ 3. Ideally, you should build with a toolchain based on GLIBC or
+ uClibc++. It you use a toolchain based on newlib, you may see
+ an error like the following:
+
+ .../lib/libsupc++.a(vterminate.o): In function `__gnu_cxx::__verbose_terminate_handler()':
+ vterminate.cc:(....): undefined reference to `_impure_ptr'
+
+ Here is a quick'n'dirty fix:
+
+ 1. Get the directory where you can find libsupc++:
+
+ arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -print-file-name=libsupc++.a
+
+ 2. Go to that directory and save a copy of vterminate.o (in case you
+ want to restore it later:
+
+ cd <the-directory-containing-libsupc++.a>
+ arm-none-eabi-ar.exe -x libsupc++.a vterminate.o
+
+ 3. Then remove vterminate.o from the library. At build time, the
+ uClibc++ package will provide a usable replacement vterminate.o.
+
+ Now NuttX should link with no problem. If you want to restore the
+ vterminate.o that you removed from libsupc++, you can do that with:
+
+ arm-none-eabi-ar.exe rcs libsupc++.a vterminate.o
+
+ 4. At present (2012/11/02), this example builds only with exceptions
disabled (CONFIG_UCLIBCXX_EXCEPTIONS=n).
elf:
diff --git a/nuttx/configs/stm32f4discovery/cxxtest/Make.defs b/nuttx/configs/stm32f4discovery/cxxtest/Make.defs
index f81d6ec2c..004643950 100644
--- a/nuttx/configs/stm32f4discovery/cxxtest/Make.defs
+++ b/nuttx/configs/stm32f4discovery/cxxtest/Make.defs
@@ -114,7 +114,7 @@ ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gc
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
LDSCRIPT = ld.script
-LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a}
+LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}"
EXTRA_LIBS = -lsupc++
diff --git a/nuttx/configs/twr-k60n512/scripts/ld.script b/nuttx/configs/twr-k60n512/scripts/ld.script
index 26410e6d8..34f1527eb 100644
--- a/nuttx/configs/twr-k60n512/scripts/ld.script
+++ b/nuttx/configs/twr-k60n512/scripts/ld.script
@@ -1,4 +1,4 @@
- /****************************************************************************
+/****************************************************************************
* configs/twr-k60n512/scripts/ld.script
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.