[libcxx-commits] [libcxx] [libc++] Improve diagnostic for libcxxabi missing from the runtimes (PR #208274)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 8 10:46:37 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Louis Dionne (ldionne)
<details>
<summary>Changes</summary>
When libc++ is configured to use libc++abi as an ABI library but libcxxabi is not part of the runtimes, we'd end up with a confusing build error about a missing <cxxabi.h> header. Instead, diagnose at CMake configuration time.
Closes #<!-- -->136480
---
Full diff: https://github.com/llvm/llvm-project/pull/208274.diff
1 Files Affected:
- (modified) libcxx/cmake/Modules/HandleLibCXXABI.cmake (+6)
``````````diff
diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
index 52236f473f35d..4b4ff7c7f9d5f 100644
--- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -148,6 +148,12 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
add_library(libcxx-abi-static-objects ALIAS cxxabi_static_objects)
endif()
+ if (NOT TARGET cxxabi_static AND NOT TARGET cxxabi_shared
+ AND NOT TARGET cxxabi_static_objects AND NOT TARGET cxxabi_shared_objects)
+ message(FATAL_ERROR "Can't find any libc++abi target but LIBCXX_CXX_ABI is set to libcxxabi, "
+ "did you forget to include libcxxabi in LLVM_ENABLE_RUNTIMES?")
+ endif()
+
# Link against a system-provided libc++abi
elseif ("${LIBCXX_CXX_ABI}" STREQUAL "system-libcxxabi")
if(NOT LIBCXX_CXX_ABI_INCLUDE_PATHS)
``````````
</details>
https://github.com/llvm/llvm-project/pull/208274
More information about the libcxx-commits
mailing list