mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 18:03:35 +08:00
Fix uClibc++ wstrlen bug
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5289 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -30,6 +30,35 @@ understand that you have tainted the NuttX BSD license with LGPLv3, and (2)
|
|||||||
copy the uClibc++ sources files into nuttx/libxx/uClibc++, include/, and
|
copy the uClibc++ sources files into nuttx/libxx/uClibc++, include/, and
|
||||||
include/uClibc++.
|
include/uClibc++.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
1. The C++ runtime support is provided by GCC libgcc_eh.a and libsupc++.a
|
||||||
|
libraries.
|
||||||
|
2. NuttX C++ support
|
||||||
|
3. Math library
|
||||||
|
4. TLS support is currenly provided only under RGMP
|
||||||
|
|
||||||
|
NuttX Configuration File Changes
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
In order to build libxx (and hence libxx/uClibc++), C++ support must be
|
||||||
|
enabled. The following must be defined in your NuttX configuration file.
|
||||||
|
|
||||||
|
CONFIG_HAVE_CXX=y
|
||||||
|
|
||||||
|
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
|
||||||
|
provided by your tooltchain. A dummy (and probably wrong) fload.h file
|
||||||
|
can be installed by setting:
|
||||||
|
|
||||||
|
CONFIG_ARCH_FLOAT_H=y
|
||||||
|
|
||||||
Make.defs File Changes
|
Make.defs File Changes
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@@ -45,6 +74,10 @@ And, of course, you no long need to suppress exceptions or run-time typing:
|
|||||||
-ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
|
-ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
|
||||||
+ARCHCPUFLAGSXX = -fno-builtin
|
+ARCHCPUFLAGSXX = -fno-builtin
|
||||||
|
|
||||||
|
|
||||||
|
I create the nuttx/configs/rgmp/x86/cxxtest/Make.def, add the two libs to EXTRA_LIBS to be linked
|
||||||
|
to NUTTX. The code.
|
||||||
|
|
||||||
Building NuttX with uClibc++
|
Building NuttX with uClibc++
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@@ -68,15 +101,6 @@ build, add the uClibc++ subdirectory to the dependency list, and add the
|
|||||||
uClibc++ subdirectory to the VPATH. That should, in principle, be all it
|
uClibc++ subdirectory to the VPATH. That should, in principle, be all it
|
||||||
takes.
|
takes.
|
||||||
|
|
||||||
Dependencies
|
|
||||||
^^^^^^^^^^^^
|
|
||||||
|
|
||||||
In order to build libxx (and hence libxx/uClibc++), CONFIG_HAVE_CXX must be
|
|
||||||
defined in your NuttX configuration file.
|
|
||||||
|
|
||||||
The C++ runtime support is provided by GCC libgcc_eh.a and libsupc++.a
|
|
||||||
libraries.
|
|
||||||
|
|
||||||
RGMP
|
RGMP
|
||||||
^^^^
|
^^^^
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace std{
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline static size_t length(const char_type* s){
|
inline static size_t length(const char_type* s){
|
||||||
return wstrlen(s);
|
return strlen(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char_type* find(const char_type* s, int n, const char_type& a);
|
static const char_type* find(const char_type* s, int n, const char_type& a);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
CXXSRCS += algorithm.cxx associative_base.cxx bitset.cxx char_traits.cxx
|
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 += complex.cxx del_op.cxx del_opnt.cxx del_opv.cxx del_opvnt.cxx
|
||||||
CXXSRCS += deque.cxx eh_alloc.cxx eh_globals.cxx exception.cxx
|
CXXSRCS += deque.cxx eh_alloc.cxx eh_globals.cxx exception.cxx
|
||||||
CXXSRCS += stream.cxx func_exception.cxx iomanip.cxx ios.cxx
|
CXXSRCS += fstream.cxx func_exception.cxx iomanip.cxx ios.cxx
|
||||||
CXXSRCS += iostream.cxx istream.cxx iterator.cxx limits.cxx list.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 += 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 += new_opv.cxx new_opvnt.cxx numeric.cxx ostream.cxx queue.cxx
|
||||||
@@ -48,5 +48,5 @@ CXXSRCS += vector.cxx
|
|||||||
|
|
||||||
# Add the path to the uClibc++ subdirectory
|
# Add the path to the uClibc++ subdirectory
|
||||||
|
|
||||||
DEPPATH += --dep-path .
|
DEPPATH += --dep-path uClibc++
|
||||||
VPATH += uClibc++
|
VPATH += uClibc++
|
||||||
|
|||||||
+1
-9
@@ -32,7 +32,7 @@ nuttx/
|
|||||||
(0) ARM/LPC43x (arch/arm/src/lpc43xx/)
|
(0) ARM/LPC43x (arch/arm/src/lpc43xx/)
|
||||||
(3) ARM/STR71x (arch/arm/src/str71x/)
|
(3) ARM/STR71x (arch/arm/src/str71x/)
|
||||||
(3) ARM/LM3S6918 (arch/arm/src/lm3s/)
|
(3) ARM/LM3S6918 (arch/arm/src/lm3s/)
|
||||||
(7) ARM/STM32 (arch/arm/src/stm32/)
|
(6) ARM/STM32 (arch/arm/src/stm32/)
|
||||||
(3) AVR (arch/avr)
|
(3) AVR (arch/avr)
|
||||||
(0) Intel x86 (arch/x86)
|
(0) Intel x86 (arch/x86)
|
||||||
(4) 8051 / MCS51 (arch/8051/)
|
(4) 8051 / MCS51 (arch/8051/)
|
||||||
@@ -1417,14 +1417,6 @@ o ARM/STM32 (arch/arm/src/stm32/)
|
|||||||
Status: Open
|
Status: Open
|
||||||
Priority: Low (I am not even sure if this is a problem yet).
|
Priority: Low (I am not even sure if this is a problem yet).
|
||||||
|
|
||||||
Status: UNFINISHED STM32 F4 OTG FS HOST DRIVER
|
|
||||||
Description: A quick-n-dirty leverage of the the LPC17xx host driver was put into
|
|
||||||
the STM32 source to support development of the STM32 F4 OTG FS host
|
|
||||||
driver. It is non-functional and still waiting for STM32 F4 logic
|
|
||||||
to be added. Don't use it!
|
|
||||||
Status: Open
|
|
||||||
Priority: Low (unless you need a host driver).
|
|
||||||
|
|
||||||
o AVR (arch/avr)
|
o AVR (arch/avr)
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user