[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
Wed Nov 11 06:28:11 PST 2020


xiaoxiang781216 added inline comments.


================
Comment at: libcxx/include/__config:27
+// not the host OS.
+#if defined(__NuttX__)
+#undef __linux__
----------------
ldionne wrote:
> I'm not comfortable with undefining these macros here in libc++. Those are compiler-defined macros, and it's not libc++'s job to undefine them.
> 
> It seems to me that you either need a compiler target triple that understands NuttX, or to do whatever macro magic you want to do lower in the stack.
Simulator is a special case here: It's a normal program run on Ubunutu or macOS and then should be compiled by host gcc toolchain, but all functions(POSIX, libc...) are provided by NuttX. If we don't undefine these macros, we have to modify every location where reference them. The later approach is very fragile and hard to maintain. Do you have other suggestion?


================
Comment at: libcxx/include/__locale:25
+#elif defined(__NuttX__)
+# include <support/nuttx/xlocale.h>
 #elif defined(_AIX)
----------------
ldionne wrote:
> Do you need this anymore? You shouldn't need it if you're using `LIBCXX_ENABLE_LOCALIZATION=OFF`.
Since stream and regex isn't supported when LIBCXX_ENABLE_LOCALIZATION=OFF, nuttx/xlocale.h is still needed to let the user turn on/off LIBCXX_ENABLE_LOCALIZATION as needed.


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