From 0b3d2b3e4bc6b4ac838545f93063bc4d38489b68 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 2 Nov 2012 16:35:37 +0000 Subject: [PATCH] More uClibc++ build fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5299 42af7a65-404d-4744-a932-0658087f49c3 --- configs/sim/README.txt | 13 +++++++++++++ configs/sim/cxxtest/Make.defs | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configs/sim/README.txt b/configs/sim/README.txt index bc8173fcf5..654ce93146 100644 --- a/configs/sim/README.txt +++ b/configs/sim/README.txt @@ -215,6 +215,19 @@ cxxtest b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration process. + 3. At presenet (2012/11/02), this example builds only with exceptions + disabled (CONFIG_UCLIBCXX_EXCEPTIONS=n). And even then, it will + not run. + + The reason that the example will will not run on the simulator has + to do with when static constructors are enabled: In the simulator + it will attempt to execute the static constructros before main() + starts. BUT... NuttX is not initialized and this results in a crash. + + To really use this example, I will have to think of some way to + postpone running C++ static initializers until NuttX has been + initialied. + mount Description diff --git a/configs/sim/cxxtest/Make.defs b/configs/sim/cxxtest/Make.defs index eba0b31dd5..7b0c524b4f 100644 --- a/configs/sim/cxxtest/Make.defs +++ b/configs/sim/cxxtest/Make.defs @@ -45,7 +45,11 @@ else endif ARCHCPUFLAGS = -fno-builtin -ARCHCPUFLAGSXX = -fno-builtin +ifeq ($(CONFIG_UCLIBCXX_EXCEPTION),y) + ARCHCPUFLAGSXX = -fno-builtin +else + ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions +endif ARCHPICFLAGS = -fpic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow ARCHWARNINGSXX = -Wall -Wshadow