Reinhard Max 2021-08-31 16:07:32 +00:00 committed by Git OBS Bridge
parent aa996e2b71
commit c1e38579a0
2 changed files with 10 additions and 15 deletions

View File

@ -12,15 +12,12 @@ causes the JIT to fail at runtime.
src/backend/jit/llvm/llvmjit.c | 46 ++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/src/backend/jit/llvm/llvmjit.c b/src/backend/jit/llvm/llvmjit.c
index 98a27f08bf..05b6438ba8 100644
--- a/src/backend/jit/llvm/llvmjit.c
+++ b/src/backend/jit/llvm/llvmjit.c
@@ -776,6 +776,35 @@ llvm_compile_module(LLVMJitContext *context)
errhidecontext(true)));
--- src/backend/jit/llvm/llvmjit.c.orig
+++ src/backend/jit/llvm/llvmjit.c
@@ -736,6 +736,35 @@ llvm_compile_module(LLVMJitContext *cont
}
+/*
/*
+ * For the systemz target, LLVM uses a different datalayout for z13 and newer
+ * CPUs than it does for older CPUs. This can cause a mismatch in datalayouts
+ * in the case where the llvm_types_module is compiled with a pre-z13 CPU
@ -49,10 +46,11 @@ index 98a27f08bf..05b6438ba8 100644
+ return ret;
+}
+
/*
+/*
* Per session initialization.
*/
@@ -785,6 +814,7 @@ llvm_session_initialize(void)
static void
@@ -744,6 +773,7 @@ llvm_session_initialize(void)
MemoryContext oldcontext;
char *error = NULL;
char *cpu = NULL;
@ -60,7 +58,7 @@ index 98a27f08bf..05b6438ba8 100644
char *features = NULL;
LLVMTargetMachineRef opt0_tm;
LLVMTargetMachineRef opt3_tm;
@@ -816,10 +846,17 @@ llvm_session_initialize(void)
@@ -775,10 +805,17 @@ llvm_session_initialize(void)
* features not all CPUs have (weird, huh).
*/
cpu = LLVMGetHostCPUName();
@ -79,7 +77,7 @@ index 98a27f08bf..05b6438ba8 100644
opt0_tm =
LLVMCreateTargetMachine(llvm_targetref, llvm_triple, cpu, features,
LLVMCodeGenLevelNone,
@@ -833,8 +870,13 @@ llvm_session_initialize(void)
@@ -792,8 +829,13 @@ llvm_session_initialize(void)
LLVMDisposeMessage(cpu);
cpu = NULL;
@ -94,6 +92,3 @@ index 98a27f08bf..05b6438ba8 100644
/* force symbols in main binary to be loaded */
LLVMLoadLibraryPermanently(NULL);
--
2.27.0

View File

@ -457,7 +457,7 @@ touch -r configure tmp
%patch9
%if %{with llvm}
%patch10
%patch11 -p1
%patch11
%endif
touch -r tmp configure
rm tmp