Hi Brian,
On Tuesday, September 30, 2014 15:42:21 Brian Paul wrote:
> Yeah, reverting that patch clears up the regression here. Please go
> ahead and do the revert if you don't think you can solve the problem
> otherwise. Thanks!
I could even reproduce the segfault with the previous patch and 3.5,
which is the one I am currently testing against.
Does the attached patch - based on master - also fix your problems
on 3.3?
... sorry, I am still iterating on a configuration that builds 3.2 or at least
3.3.
Thanks for your patience!
Mathias
>From 321aecdcebd9844568985e1064d6679e04cf6e2a Mon Sep 17 00:00:00 2001
Message-Id: <321aecdcebd9844568985e1064d6679e04cf6e2a.1412113717.git.mathias.froehl...@gmx.net>
From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= <mathias.froehl...@gmx.net>
Date: Tue, 30 Sep 2014 22:11:30 +0200
Subject: [PATCH] gallivm: fix build for LLVM 3.2
---
src/gallium/auxiliary/gallivm/lp_bld.h | 8 ++++++++
src/gallium/auxiliary/gallivm/lp_bld_init.c | 4 +---
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 9 +++++++++
src/gallium/auxiliary/gallivm/lp_bld_misc.h | 3 +++
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld.h b/src/gallium/auxiliary/gallivm/lp_bld.h
index fcf4f16..a01c216 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld.h
@@ -58,6 +58,14 @@
#endif
+#if HAVE_LLVM <= 0x0303
+/* We won't actually use LLVMMCJITMemoryManagerRef, just create a dummy
+ * typedef to simplify things elsewhere.
+ */
+typedef void *LLVMMCJITMemoryManagerRef;
+#endif
+
+
/**
* Redefine these LLVM entrypoints as invalid macros to make sure we
* don't accidentally use them. We need to use the functions which
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 4e4aecb..8d7a0b6 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -219,10 +219,8 @@ gallivm_free_code(struct gallivm_state *gallivm)
assert(!gallivm->engine);
lp_free_generated_code(gallivm->code);
gallivm->code = NULL;
-#if HAVE_LLVM < 0x0306
- LLVMDisposeMCJITMemoryManager(gallivm->memorymgr);
+ lp_free_memory_manager(gallivm->memorymgr);
gallivm->memorymgr = NULL;
-#endif
}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index c173ab6..9c2de2c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -554,3 +554,12 @@ lp_get_default_memory_manager()
return 0;
#endif
}
+
+extern "C"
+void
+lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr)
+{
+#if HAVE_LLVM < 0x0306
+ delete reinterpret_cast<llvm::JITMemoryManager*>(memorymgr);
+#endif
+}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index 40d3e79..36923aa 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -65,6 +65,9 @@ lp_free_generated_code(struct lp_generated_code *code);
extern LLVMMCJITMemoryManagerRef
lp_get_default_memory_manager();
+extern void
+lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
+
#ifdef __cplusplus
}
#endif
--
1.9.3
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev