summaryrefslogtreecommitdiff
path: root/dev-db/postgresql/files
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/postgresql/files')
-rw-r--r--dev-db/postgresql/files/postgresql-17.6-llvm21.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-db/postgresql/files/postgresql-17.6-llvm21.patch b/dev-db/postgresql/files/postgresql-17.6-llvm21.patch
new file mode 100644
index 000000000000..90e32e872be1
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-17.6-llvm21.patch
@@ -0,0 +1,36 @@
+From 282d0bdee6192f1a859ee34672ae73abf49794dc Mon Sep 17 00:00:00 2001
+From: Peter Eisentraut <peter@eisentraut.org>
+Date: Mon, 15 Sep 2025 08:13:21 +0200
+Subject: [PATCH 1/1] jit: fix build with LLVM-21
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+LLVM-21 renamed llvm::GlobalValue::getGUID() to
+getGUIDAssumingExternalLinkage(), so add a version guard.
+
+Author: Holger Hoffstätte <holger@applied-asynchrony.com>
+Discussion: https://www.postgresql.org/message-id/flat/d25e6e4a-d1b4-84d3-2f8a-6c45b975f53d%40applied-asynchrony.com
+---
+ src/backend/jit/llvm/llvmjit_inline.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
+index 2764c3bbe2f..51b32cd9f94 100644
+--- a/src/backend/jit/llvm/llvmjit_inline.cpp
++++ b/src/backend/jit/llvm/llvmjit_inline.cpp
+@@ -238,7 +238,11 @@ llvm_build_inline_plan(LLVMContextRef lc, llvm::Module *mod)
+
+ llvm_split_symbol_name(symbolName.data(), &cmodname, &cfuncname);
+
++#if LLVM_VERSION_MAJOR >= 21
++ funcGUID = llvm::GlobalValue::getGUIDAssumingExternalLinkage(cfuncname);
++#else
+ funcGUID = llvm::GlobalValue::getGUID(cfuncname);
++#endif
+
+ /* already processed */
+ if (inlineState.processed)
+--
+2.39.5
+