From 4dbeffdd45e8c8f21d626e498b0e6971b76132fa Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 3 Nov 2012 13:02:31 +0000 Subject: uClibc++ updates git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5302 42af7a65-404d-4744-a932-0658087f49c3 --- misc/uClibc++/README.txt | 70 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 6 deletions(-) (limited to 'misc/uClibc++/README.txt') diff --git a/misc/uClibc++/README.txt b/misc/uClibc++/README.txt index 6fedcb67f..751f23587 100755 --- a/misc/uClibc++/README.txt +++ b/misc/uClibc++/README.txt @@ -6,9 +6,20 @@ originates from http://cxx.uclibc.org/ and has been adapted for NuttX by the RGMP team (http://rgmp.sourceforge.net/wiki/index.php/Main_Page). uClibc++ resides in the misc/ directory rather than in the main NuttX source -tree due to licensing issues: NuttX is licensed under the permissiv - modified BSD License; uClibc, on the other hand, islicensed under the - stricter GNU LGPL Version 3 license. +tree due to licensing issues: NuttX is licensed under the permissive +modified BSD License; uClibc, on the other hand, is licensed under the +stricter GNU LGPL Version 3 license. + +Contents: +^^^^^^^^^ + + o Installation of uClibc++ + o Dependencies + o NuttX Configuration File Changes + o Make.defs File Changes + o Building NuttX with uClibc++ + o Callbacks + o RGMP Installation of uClibc++ ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -50,7 +61,6 @@ enabled. The following must be defined in your NuttX configuration file. There are many ways to provide math library support (see nuttx/README.txt). If you choose to use the NuttX math library, that is enabled as follows: - CONFIG_LIBM=y The math libraries depend on the float.h header file that is normally @@ -59,6 +69,10 @@ can be installed by setting: CONFIG_ARCH_FLOAT_H=y +Exception support can be enabled with: + + CONFIG_UCLIBCXX_EXCEPTION=y + Make.defs File Changes ^^^^^^^^^^^^^^^^^^^^^^ @@ -74,9 +88,25 @@ And, of course, you no long need to suppress exceptions or run-time typing: -ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti +ARCHCPUFLAGSXX = -fno-builtin +If exceptions are disabled via CONFIG_UCLIBCXX_EXCEPTION=n, then -fno-exceptions +is still required. This logic would handle both cases: -I create the nuttx/configs/rgmp/x86/cxxtest/Make.def, add the two libs to EXTRA_LIBS to be linked -to NUTTX. The code. + ifeq ($(CONFIG_UCLIBCXX_EXCEPTION),y) + ARCHCPUFLAGSXX = -fno-builtin + else + ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions + endif + +To get the required libraries into to the NuttX build, it is necessary to add +them to EXTRA_LIBS and to EXTRA_LIBPATHS. + + LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a} + EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}" + EXTRA_LIBS = -lsupc++ + +NOTE: This assumes that support for these options has been incorporated into +arch//src/Makefile. As of this writing that is true only for +the ARM and simulation platforms. Building NuttX with uClibc++ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,6 +131,34 @@ build, add the uClibc++ subdirectory to the dependency list, and add the uClibc++ subdirectory to the VPATH. That should, in principle, be all it takes. +Callbacks +^^^^^^^^^ + +The runtime will call this function if exception handling must be abandoned +for any reason. + + void std::terminate(void) throw(); + +NOTE: If exception handling is disabled via CONFIG_UCLIBCXX_EXCEPTION, then +this function is always called when an exception would have been thrown. + +By default, std::terminate() just calls abort(), but that can be changed +with std:terminate(). std::set_terminated takes a new handler function +as an argument and returns the old handler: + + typedef CODE void (*terminate_handler)(void); + terminate_handler std::set_terminate(std::terminate_handler func) throw(); + +The runtime will call this function if an exception is thrown which violates +the function's %exception specification: + + void std::unexpected(void) throw() + +This handler defaults to std::terminate but can be re-directed with: + + typedef CODE void (*unexpected_handler)(void); + unexpected_handler set_unexpected(unexpected_handler) throw(); + RGMP ^^^^ -- cgit v1.2.3