diff options
author | Mark de Wever <koraq@xs4all.nl> | 2023-12-12 17:11:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 17:11:53 +0100 |
commit | ed210f9f5aab70cf4ca242535d1af0b0aa6a5781 (patch) | |
tree | 9396b3f5842a8a5f754146fef8d4139b5065abf8 | |
parent | c209d56e0fd3e8db358515dec5e85fdac2d8295d (diff) | |
download | llvm-ed210f9f5aab70cf4ca242535d1af0b0aa6a5781.zip llvm-ed210f9f5aab70cf4ca242535d1af0b0aa6a5781.tar.gz llvm-ed210f9f5aab70cf4ca242535d1af0b0aa6a5781.tar.bz2 |
[libc++][CI] Tests the no RTTI configuration. (#65518)
There are a few drive-by fixes:
- Since the combination RTTI disabled and exceptions enabled do not
work, this combination is prohibited.
- A small NFC in any fixing clang-tidy.
The code in the Buildkite configuration is prepared for using the std
module. There are more fixes needed for that configuration which will be
done in a separate commit.
-rw-r--r-- | .github/workflows/libcxx-build-and-test.yaml | 1 | ||||
-rw-r--r-- | libcxx/CMakeLists.txt | 11 | ||||
-rw-r--r-- | libcxx/cmake/caches/Generic-no-rtti.cmake | 4 | ||||
-rw-r--r-- | libcxx/docs/BuildingLibcxx.rst | 1 | ||||
-rwxr-xr-x | libcxx/utils/ci/run-buildbot | 5 |
5 files changed, 21 insertions, 1 deletions
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml index 268e103..370cf83 100644 --- a/.github/workflows/libcxx-build-and-test.yaml +++ b/.github/workflows/libcxx-build-and-test.yaml @@ -160,6 +160,7 @@ jobs: 'generic-no-tzdb', 'generic-no-unicode', 'generic-no-wide-characters', + 'generic-no-rtti', 'generic-static', 'generic-with_llvm_unwinder', # TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 31fc9ce..7751bf1 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -284,7 +284,9 @@ endif() # Feature options ------------------------------------------------------------- option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON) -option(LIBCXX_ENABLE_RTTI "Use run time type information." ON) +option(LIBCXX_ENABLE_RTTI + "Use runtime type information. + This option may only be set to OFF when LIBCXX_ENABLE_EXCEPTIONS=OFF." ON) option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. @@ -374,6 +376,13 @@ if (LIBCXX_HAS_PTHREAD_API) endif() endif() +if (NOT LIBCXX_ENABLE_RTTI AND LIBCXX_ENABLE_EXCEPTIONS) + message(FATAL_ERROR "Libc++ cannot be built with exceptions enabled but RTTI" + " disabled, since that configuration is broken. See" + " https://github.com/llvm/llvm-project/issues/66117" + " for details.") +endif() + # Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE # is ON. if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE) diff --git a/libcxx/cmake/caches/Generic-no-rtti.cmake b/libcxx/cmake/caches/Generic-no-rtti.cmake new file mode 100644 index 0000000..c62ddce --- /dev/null +++ b/libcxx/cmake/caches/Generic-no-rtti.cmake @@ -0,0 +1,4 @@ +set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "") +set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") +set(LIBCXXABI_ENABLE_RTTI OFF CACHE BOOL "") +set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst index 2cee97c..0b4d4205 100644 --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -369,6 +369,7 @@ libc++ Feature Options **Default**: ``ON`` Build libc++ with run time type information. + This option may only be set to OFF when LIBCXX_ENABLE_EXCEPTIONS=OFF. .. option:: LIBCXX_INCLUDE_TESTS:BOOL diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index 445b1be..ee890fb 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -472,6 +472,11 @@ generic-no-exceptions) check-runtimes check-abi-list ;; +generic-no-rtti) + clean + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-rtti.cmake" + check-runtimes +;; # # Other miscellaneous jobs # |