Skip to content

[libc++][CI] Tests the no RTTI configuration. #65518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions libcxx/cmake/caches/Generic-no-rtti.cmake
Original file line number Diff line number Diff line change
@@ -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 "")
1 change: 1 addition & 0 deletions libcxx/docs/BuildingLibcxx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions libcxx/utils/ci/run-buildbot
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down