[libcxx-commits] [PATCH] D86704: [libcxx] Add testing infrastructure for EXTERNAL_THREAD_API mode

Mikhail Maltsev via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 27 08:20:10 PDT 2020


miyuki added inline comments.


================
Comment at: libcxx/CMakeLists.txt:262
      This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF)
+option(LIBCXX_TESTING_EXTERNAL_THREAD_API
+  "Build libc++ with an example externalized threading API provided
----------------
ldionne wrote:
> I would like this test to be enabled unconditionally. We should always be testing it, and I don't want to add more logic to the CMake just to enable a test for another configuration.
> 
> Also, since this is just adding a test, we should be able to do so without touching the main `CMakeLists.txt` at all. The only code changes should be under `libcxx/test`, and the test should run through Lit like the other ones. I recognize this might be more work, but stringing the test of a given configuration by hacking around libc++'s build itself is just not a sustainable direction.
Normally enabling `LIBCXX_HAS_EXTERNAL_THREAD_API` requires the vendor to provide a version of `__external_threading` (e.g. like we do in the Arm Compiler toolchain) in the include directory. It is intended to be vendor-specific and unfortunately, it is needed at build time (not just during the test run).

`LIBCXX_TESTING_EXTERNAL_THREAD_API` makes the library use an example version of `__external_threading` from `test/support/external-thread-api` which relies on `example_thread_library.c` and its symbols. The intent is to check that the `LIBCXX_HAS_EXTERNAL_THREAD_API` mode works in principle.

So unfortunately I don't see a way to test the `LIBCXX_HAS_EXTERNAL_THREAD_API` configuration without modifications in the build logic of the library itself. @ldionne, what do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86704



More information about the libcxx-commits mailing list