summaryrefslogtreecommitdiff
path: root/dev-db/postgresql/files/postgresql-17.6-llvm21.patch
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2025-09-15 09:09:15 +0000
committerPatrick Lauer <patrick@gentoo.org>2025-09-15 09:09:35 +0000
commit6c433f974e7cbf9ffe242e4f768136978e647008 (patch)
tree55f93f92f01324a9d72b086b8af5349b1414f5b8 /dev-db/postgresql/files/postgresql-17.6-llvm21.patch
parent96f62bfe26d67c216854ba0630f6cb9097b0e2bf (diff)
downloadgentoo-6c433f974e7cbf9ffe242e4f768136978e647008.tar.gz
gentoo-6c433f974e7cbf9ffe242e4f768136978e647008.tar.bz2
gentoo-6c433f974e7cbf9ffe242e4f768136978e647008.zip
dev-db/postgresql: Support LLVM 21
Signed-off-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'dev-db/postgresql/files/postgresql-17.6-llvm21.patch')
-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
+