{{ message }}
Prototype own CMake configuration for llvm-project#97453
Merged
Conversation
Contributor
Member
|
The |
Member
Author
Replace the upstream LLVM CMake with a custom build that explicitly lists source files, runs tablegen, and builds individual LLVM static libraries. This gives full control over compilation flags and dependencies while significantly reducing CMake configure time. Assisted-by: Claude Sonnet 4.5 via GitHub Copilot
…Make build Add source file lists for AArch64, PowerPC, SystemZ, and RISCV targets with their respective tablegen rules. Add missing LLVM libraries needed for linking: CGData, ObjCARCOpts, IRPrinter, CFGuard, FrontendOpenMP, FrontendOpenACC, FrontendOffloading, Coroutines, and SandboxIR. Also add BLAKE3 sources to LLVMSupport and DWARF LowLevel sources to LLVMDebugInfoDWARF. Assisted-by: Claude Opus 4.6
When cross-compiling (e.g., ARM host building for x86_64), tablegen tools must be built for the host system to be executable during the build process. Previously, tablegen was built with the target sysroot, making the binaries reference target system libraries that don't exist on the host. This commit: - Detects cross-compilation via CMAKE_CROSSCOMPILING - Uses ExternalProject_Add to build native tablegen without toolchain - Copies GenVT.inc from native build to target build directory - Updates tablegen macros to use LLVM_TABLEGEN_EXE variable Fixes CI failures with error: x86_64-binfmt-P: Could not open '/lib64/ld-linux-x86-64.so.2'
Remove X86CompressEVEXTablesEmitter.cpp and X86ManualInstrMapping.cpp from the native-tblgen source list - these files don't exist in ClickHouse's LLVM fork.
- Use CMake variables in config.h.in for platform-specific defines - Set HAVE_MALLINFO only on Linux with glibc (not musl/BSD/macOS) - Set HAVE_GETAUXVAL only on Linux (it's Linux-specific) - Set HAVE_MACH_MACH_H, HAVE_MALLOC_MALLOC_H for macOS - Use st_mtimespec on macOS/FreeBSD, st_mtim on Linux - Set HAVE_DECL_ARC4RANDOM on macOS/FreeBSD - Use .dylib extension on macOS, .so elsewhere - Apply same logic to native-tblgen using CMAKE_HOST_SYSTEM_NAME
- Disable HAVE_BACKTRACE on musl (no execinfo.h) - Don't link with -ldl on musl (dlopen is in libc) - Use USE_MUSL variable for proper detection Assisted-by: Claude Opus 4.5 via GitHub Copilot
…nACC Remove LLVM components that ClickHouse doesn't need: - LLVMFrontendOpenACC library (and its tablegen commands) - Architecture AsmParser libraries (all 5 targets) - Architecture Disassembler libraries (all 5 targets) - -gen-disassembler tablegen commands This reduces build time and binary size without affecting functionality. Assisted-by: Claude Opus 4.5 via GitHub Copilot
da19bde to
40500cd
Compare
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Provide own CMake configuration for
llvm-projectinstead of importing upstream one.Version info
26.4.1.971