freebsd-ports/databases/postgresql14-server/files/patch-disable-llvm-jit-inlining-with-tls
Palle Girgensohn fccc45e5ff databases/postgresql14-*: Add postgresql 14 beta1 the the ports tree.
Release notes:	https://www.postgresql.org/docs/devel/release-14.html

Also reintroduce parallel builds. Some components, namely plperl,
plpython, pltcl and contrib, fail to build properly when using parallel
builds. Something with static linking using `ar` that fails.
MAKE_JOBS_UNSAFE is set for these ports.
2021-05-20 16:38:55 +02:00

24 lines
856 B
Text

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.