Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

LLVM libc++ for NuttX

From Alan Carvalho de Assis

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:

Code Block
  $ git clone https://bitbucket.org/acassis/libcxx
  Cloning into 'libcxx'...
  ...
Code Block
  $ git clone https://bitbucket.org/acassis/nuttx_libcxx
  Cloning into 'nuttx_libcxx'...
  ...
Code Block
  $ git clone https://bitbucket.org/nuttx/apps
  Cloning into 'apps'...
  ...
Code Block
  $ cd libcxx/
  libcxx$ ./install.sh ../nuttx_libcxx
  Installing LLVM/libcxx in the NuttX source tree
  Installation suceeded
Code Block
  libcxx$ cd ../nuttx_libcxx/
  nuttx_libcxx$ tools/configure.sh stm32f4discovery:libcxx-hello
  nuttx_libcxx$ make

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

Code Block
  NuttShell (NSH)
  nsh>?
  help usage: help [-v] [<cmd>]
Code Block
  [ 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
Code Block
  Builtin Apps:
  helloxx
  nsh>helloxx
  helloxx [2:100]
  nsh>
  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!!