LLVM stdc++ for NuttX

From Alan Carvalho de Assiss

I was looking for a C++11 lib to integrated on NuttX for a customer's project because uClibc++ doesn't have the C++11 features they need. Then David suggested me to take a look on LLVM's libcxx.

Finally I integrated libcxx on NuttX in the same way uClibc++ was integrated.

Case you have a STM32F4Discovery board and want to test, just follow these steps:

$ git clone https://bitbucket.org/acassis/libcxx
Cloning into 'libcxx'...

$ git clone https://bitbucket.org/acassis/nuttx_libcxx
Cloning into 'nuttx_libcxx'...

$ git clone https://bitbucket.org/nuttx/apps
Cloning into 'apps'...

$ cd libcxx/
libcxx$ ./install.sh ../nuttx_libcxx
Installing LLVM/libcxx in the NuttX source tree
Installation suceeded

libcxx$ cd ../nuttx_libcxx/

nuttx_libcxx$ cd tools/

nuttx_libcxx/tools$ ./configure.sh stm32f4discovery/libcxx-hello
nuttx_libcxx/tools$ cd ..
nuttx_libcxx$ make

Flash nuttx.bin in the STM32F4Discovery. Then in the serial console execute:

NuttShell (NSH)
help usage: help [-v] [<cmd>]

[ cmp free mh sh usleep
? dirname help mv sleep xd
basename dd hexdump mw test
break echo kill pwd time
cat exec ls rm true
cd exit mb rmdir uname
cp false mkdir set unset

Builtin Apps:
helloxx [2:100]
CHelloWorld::HelloWorld: Hello, World!!
helloxx_main: Saying hello from the instance constructed on the stack
CHelloWorld::HelloWorld: Hello, World!!
helloxx_main: Saying hello from the statically constructed instance
CHelloWorld::HelloWorld: Hello, World!!