Source: apache-arrow
Version: 25.0.0-2
Severity: important
Tags: ftbfs patch
User: [email protected]
Usertags: llvm-23-default
Control: affects -1 + src:llvm-defaults
Control: block 1154024 by -1
Hello,
We are going to switch the default LLVM version to 23 (transition bug
#1154024). llvm-defaults 0.75~exp1, in experimental, already points to
23.
apache-arrow fails to build in unstable with it, and builds without it:
CMake Warning at cmake_modules/FindLLVMAlt.cmake:58 (find_package):
Could not find a configuration file for package "LLVM" that is compatible
with requested version [...]
/usr/lib/llvm-23/lib/cmake/llvm/LLVMConfig.cmake, version: 23.1.3
Gandiva has a fixed list of supported LLVM versions, ARROW_LLVM_VERSIONS
in cpp/CMakeLists.txt:181, which stops at 22.1. With "23.1" added, the
build goes further and fails in cpp/src/gandiva/engine.cc:213: since
LLVM 23, the ObjectLinkingLayerCreator callback also gets the
JITLinkMemoryManager.
The attached debdiff fixes both. apache-arrow builds with it, tests included.
To reproduce, with sbuild:
sbuild -d unstable \
--extra-repository='deb http://deb.debian.org/debian experimental main' \
--build-dep-resolver=aptitude \
--add-depends='clang (>= 1:23~), llvm-dev (>= 1:23~), libclang-dev (>=
1:23~)' \
<package>
The --add-depends forces the llvm-defaults packages from experimental
(the default apt resolver won't pick them, aptitude does), everything
else comes from unstable.
The severity will be raised to serious once llvm-defaults 23 is in
unstable.
Cheers,
Sylvestre
diff --git a/debian/patches/llvm-23.patch b/debian/patches/llvm-23.patch
new file mode 100644
index 0000000..56bcfae
--- /dev/null
+++ b/debian/patches/llvm-23.patch
@@ -0,0 +1,38 @@
+Description: Build Gandiva with LLVM 23
+ * Add 23.1 to the supported LLVM versions.
+ * The ObjectLinkingLayerCreator callback gets the JITLinkMemoryManager
+ since LLVM 23.
+Author: Sylvestre Ledru <[email protected]>
+Forwarded: no
+Last-Update: 2026-11-15
+---
+Index: apache-arrow-25.0.0/cpp/CMakeLists.txt
+===================================================================
+--- apache-arrow-25.0.0.orig/cpp/CMakeLists.txt
++++ apache-arrow-25.0.0/cpp/CMakeLists.txt
+@@ -179,6 +179,7 @@ set(ARROW_DOC_DIR "${CMAKE_INSTALL_DOCDI
+ set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
+
+ set(ARROW_LLVM_VERSIONS
++ "23.1"
+ "22.1"
+ "21.1"
+ "20.1"
+Index: apache-arrow-25.0.0/cpp/src/gandiva/engine.cc
+===================================================================
+--- apache-arrow-25.0.0.orig/cpp/src/gandiva/engine.cc
++++ apache-arrow-25.0.0/cpp/src/gandiva/engine.cc
+@@ -209,7 +209,12 @@ Status UseJITLinkIfEnabled(llvm::orc::LL
+ static auto maybe_use_jit_link = ::arrow::internal::GetEnvVar("GANDIVA_USE_JIT_LINK");
+ if (maybe_use_jit_link.ok()) {
+ ARROW_ASSIGN_OR_RAISE(static auto memory_manager, CreateMemmoryManager());
+-# if LLVM_VERSION_MAJOR >= 21
++# if LLVM_VERSION_MAJOR >= 23
++ jit_builder.setObjectLinkingLayerCreator(
++ [&](llvm::orc::ExecutionSession& ES, llvm::jitlink::JITLinkMemoryManager&) {
++ return std::make_unique<llvm::orc::ObjectLinkingLayer>(ES, *memory_manager);
++ });
++# elif LLVM_VERSION_MAJOR >= 21
+ jit_builder.setObjectLinkingLayerCreator([&](llvm::orc::ExecutionSession& ES) {
+ return std::make_unique<llvm::orc::ObjectLinkingLayer>(ES, *memory_manager);
+ });
diff --git a/debian/patches/series b/debian/patches/series
index 0968955..1712f76 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
use-debian-mimalloc.patch
build-sse4.2-kernels.patch
gandiva-riscv64-pic-jit.patch
+llvm-23.patch