[libcxx-commits] [PATCH] D88718: [libcxx] Port to NuttX(https://nuttx.apache.org/) RTOS

Xiang Xiao via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 2 10:22:08 PDT 2020


xiaoxiang781216 added inline comments.


================
Comment at: libcxx/include/__config:1127
       defined(__NetBSD__) || \
+      defined(__NuttX__) || \
       defined(__linux__) || \
----------------
mclow.lists wrote:
> How does `__NuttX__` get defined?
It get defined in two ways:
1.Build toolchain target NuttX OS from here:
   https://github.com/NuttX/buildroot
   The result binary define __NuttX__ automatically just like how Linux toolchain define __linux__
2.Define __NuttX__ from the board/toolchain specific Makefile, like this:
   https://github.com/apache/incubator-nuttx/blob/master/boards/arm/imxrt/imxrt1050-evk/configs/libcxxtest/Make.defs#L77
   


================
Comment at: libcxx/include/support/nuttx/xlocale.h:17
+
+#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
+
----------------
mclow.lists wrote:
> This change probably belongs in `__config`
Yes, could be, but I want to minize the change as small as possible. But if you want, I will move the change to __config.


================
Comment at: libcxx/include/support/nuttx/xlocale.h:24
+#undef _NEWLIB_VERSION
+
+#endif // __NuttX__
----------------
mclow.lists wrote:
> Why all the `#undef`s?
NuttX support a special target platform named sim which is basically a normal process running on Linux/macOS/Cygwin, but simulate all OS API inside it. Since it is built by the host toolchain, I have to undef these macros to avoid libcxx detect the wrong target. Here is more info about simulator:
https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Simulation


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88718/new/

https://reviews.llvm.org/D88718



More information about the libcxx-commits mailing list