Skip to content

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Oct 23, 2025

The LLVM-customized GTest has a dependency on LLVM to support llvm::raw_ostream and hence has to link to LLVMSupport. The runtimes use the LLVMSupport from the bootstrapping LLVM build. The problem is that the boostrapping compiler and the runtimes target can diverge in their ABI, even in the runtimes default build. For instance, Clang is built using gcc which uses libstdc++, but the runtimes is built by Clang which can be configured to use libcxx by default. This has caused flang-aarch64-libcxx) to break, and is still broken.

This patch makes the runtimes' GTest independent from LLVMSupport so we do not link any runtimes component with LLVM components.

Runtime projects that use GTest unittests:

The current state of this PR tries to reuse https://github.com/llvm/llvm-project/blob/main/third-party/unittest/CMakeLists.txt as much as possible, altough personally I would prefer to make it use "modern CMake" style. A new macro build_gtest adds a configurable build of GTest, one for LLVM (llvm_gtest, NFCI) and another one for the runtimes (runtimes_gtest). It is not possible to reuse llvm_gtest for both since llvm_gtest is imported using find_package(LLVM) if LLVM_INSTALL_GTEST. An alias default_gtest is used to select between the two. default_gtest could also be used for openmp which also supports standalone and LLVM_ENABLE_PROJECTS build mode.

@github-actions
Copy link

github-actions bot commented Oct 23, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

CFI_attribute_t attribute, CFI_type_t type, std::size_t elem_len,
CFI_rank_t rank, const CFI_index_t extents[]) {
#ifdef VERBOSE
DumpTestWorld(base_addr, attribute, type, elem_len, rank, extent);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not even compile (extents)

@Meinersbur Meinersbur requested review from jplehr and mhalk October 23, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant