aboutsummaryrefslogtreecommitdiffstats
path: root/main/postgresql/0001-jit-Don-t-use-host-specific-CPU-or-features.patch
blob: 94076de622d64e62c81af253cc0fcc13cc895c1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/src/backend/jit/llvm/llvmjit.c
+++ b/src/backend/jit/llvm/llvmjit.c
@@ -815,10 +815,20 @@
 	 * latter is needed because some CPU architectures default to enabling
 	 * features not all CPUs have (weird, huh).
 	 */
-	cpu = LLVMGetHostCPUName();
-	features = LLVMGetHostCPUFeatures();
-	elog(DEBUG2, "LLVMJIT detected CPU \"%s\", with features \"%s\"",
-		 cpu, features);
+
+	/* FIXME: When compile code to pass to the JIT, we are pulling the
+        
+        * datalayout from the llvmjit_types.bc, which is compiled at build
+        
+        * type without any specifc CPU or feature flags.  This can lead to
+        
+        * a mismatch between the JIT's datalayout and the code's datalayout
+        
+        * if we initialize the JIT for a specific CPU.  So for now don't use
+        
+        * any host specific cpu features when creating the JIT.
+        
+        */
 
 	opt0_tm =
 		LLVMCreateTargetMachine(llvm_targetref, llvm_triple, cpu, features,