[libcxx-commits] [PATCH] D93971: Add freestanding parameter to libcxx lit

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 25 07:39:51 PST 2021

ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.

Comment at: libcxx/utils/libcxx/test/params.py:42-50
+  AddCompileFlag('-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE'), AddFeature('libcpp-has-no-global-filesystem-namespace'),
+  AddCompileFlag('-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK'), AddFeature('libcpp-has-no-monotonic-clock'),
+  AddCompileFlag('-D_LIBCPP_HAS_NO_STDIN'), AddFeature('libcpp-has-no-stdin'),
+  AddCompileFlag('-D_LIBCPP_HAS_NO_STDOUT'), AddFeature('libcpp-has-no-stdout'),
+  AddCompileFlag('-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS'), AddFeature('libcpp-has-no-thread-unsafe-c-functions'),
+  AddCompileFlag('-D_LIBCPP_HAS_NO_THREADS'), AddFeature('libcpp-has-no-threads'),
+  AddCompileFlag('-D_LIBCPP_NO_VCRUNTIME'), AddFeature('libcpp-no-vcruntime'),
These options are meant to be determined at libc++ configuration time (in CMake). They are not meant to be overriden on the command-line. In other words, a "general" build of libc++ may not support defining these macros like we're doing here.

I believe we should treat libc++ and its test suite as separate entities here. Basically, let's add support for running only the freestanding parts of the test suite, but let's not tie libc++ configuration to it. If you want to a C++ Library implementation against the Freestanding spec, the idea would be:

1. Build your C++ Library implementation in a way that you think it satisfies Freestanding (for libc++, that would mean defining all the macros above at CMake configure time).
2. Run the test suite against your implementation, enabling only the freestanding subset.

If we do it that way, this patch wouldn't contain anything specifically related to libc++. What do you think?

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list