summaryrefslogtreecommitdiff
path: root/databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls
diff options
context:
space:
mode:
authorPalle Girgensohn <girgen@FreeBSD.org>2022-05-18 21:11:48 +0200
committerPalle Girgensohn <girgen@FreeBSD.org>2022-05-19 15:36:48 +0200
commit5b11f47f0d59c95f6dcf1ff75badede5ec84e72e (patch)
treeddbd6345593e54c390ac3b9b04b4403cae76366b /databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls
parentshell/zsh: remove unnneeded patch (diff)
databases/postgresql??-*: add postgresql-15 to the ports tree
Introduce PostgreSQL-15 to the ports tree. Make version 15 the master port, and add plist parameter for the postgresql version. Release notes: https://www.postgresql.org/docs/devel/release.html
Diffstat (limited to '')
-rw-r--r--databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls24
1 files changed, 24 insertions, 0 deletions
diff --git a/databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls b/databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls
new file mode 100644
index 000000000000..02686061ce99
--- /dev/null
+++ b/databases/postgresql15-server/files/patch-disable-llvm-jit-inlining-with-tls
@@ -0,0 +1,24 @@
+Do not inline functions which access TLS in LLVM JIT, as
+this leads to crashes with unsupported relocation error
+
+diff --git src/backend/jit/llvm/llvmjit_inline.cpp src/backend/jit/llvm/llvmjit_inline.cpp
+index 2617a46..a063edb 100644
+--- src/backend/jit/llvm/llvmjit_inline.cpp
++++ src/backend/jit/llvm/llvmjit_inline.cpp
+@@ -608,6 +608,16 @@ function_inlinable(llvm::Function &F,
+ if (rv->materialize())
+ elog(FATAL, "failed to materialize metadata");
+
++ /*
++ * Don't inline functions with thread-local variables until
++ * related crashes are investigated (see BUG #16696)
++ */
++ if (rv->isThreadLocal()) {
++ ilog(DEBUG1, "cannot inline %s due to thread-local variable %s",
++ F.getName().data(), rv->getName().data());
++ return false;
++ }
++
+ /*
+ * Never want to inline externally visible vars, cheap enough to
+ * reference.