summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Rawlins <monster.romster@gmail.com>2012-07-23 12:28:51 +1000
committerDanny Rawlins <monster.romster@gmail.com>2012-07-23 12:29:06 +1000
commite3c7d1713f110baeb4363b7248dd13f7d156e700 (patch)
tree6f83f62ed87121ffbc75eeabb62c01174c7fa49f
parentecc3f80c5ab0b03d42d90197d9a9f8abdc6b686a (diff)
downloadxorg-e3c7d1713f110baeb4363b7248dd13f7d156e700.tar.gz
xorg-e3c7d1713f110baeb4363b7248dd13f7d156e700.tar.xz
mesa3d: fix compile with later llvm versions
-rw-r--r--mesa3d/.md5sum1
-rw-r--r--mesa3d/Pkgfile7
-rw-r--r--mesa3d/mesa-8.0.3-llvm-3.1-fixes.patch44
3 files changed, 50 insertions, 2 deletions
diff --git a/mesa3d/.md5sum b/mesa3d/.md5sum
index 74870d08..fbdcd859 100644
--- a/mesa3d/.md5sum
+++ b/mesa3d/.md5sum
@@ -1 +1,2 @@
d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2
+0082f4d17674155aa13bc611a5687788 mesa-8.0.3-llvm-3.1-fixes.patch
diff --git a/mesa3d/Pkgfile b/mesa3d/Pkgfile
index 8d43caea..d4da8951 100644
--- a/mesa3d/Pkgfile
+++ b/mesa3d/Pkgfile
@@ -5,12 +5,15 @@
name=mesa3d
version=8.0.4
-release=1
-source=(ftp://ftp.freedesktop.org/pub/mesa/$version/MesaLib-$version.tar.bz2)
+release=2
+source=(ftp://ftp.freedesktop.org/pub/mesa/$version/MesaLib-$version.tar.bz2
+ mesa-8.0.3-llvm-3.1-fixes.patch)
build() {
cd Mesa-$version
+ patch -p 1 -i $SRC/mesa-8.0.3-llvm-3.1-fixes.patch
+
./configure --prefix=/usr \
--with-dri-drivers=i915,i965,r200,radeon,swrast \
--with-gallium-drivers=i915,r600,svga \
diff --git a/mesa3d/mesa-8.0.3-llvm-3.1-fixes.patch b/mesa3d/mesa-8.0.3-llvm-3.1-fixes.patch
new file mode 100644
index 00000000..922577ae
--- /dev/null
+++ b/mesa3d/mesa-8.0.3-llvm-3.1-fixes.patch
@@ -0,0 +1,44 @@
+diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+index a50a51d..f1bb4d9 100644
+--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
++++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+@@ -235,7 +235,24 @@ lp_disassemble(const void* func)
+ int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
+ #endif
+
+-#if HAVE_LLVM >= 0x0300
++#if HAVE_LLVM >= 0x0301
++ OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
++ if (!MRI) {
++ debug_printf("error: no register info for target %s\n", Triple.c_str());
++ return;
++ }
++
++ OwningPtr<const MCInstrInfo> MII(T->createMCInstrInfo());
++ if (!MII) {
++ debug_printf("error: no instruction info for target %s\n", Triple.c_str());
++ return;
++ }
++#endif
++
++#if HAVE_LLVM >= 0x0301
++ OwningPtr<MCInstPrinter> Printer(
++ T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
++#elif HAVE_LLVM == 0x0300
+ OwningPtr<MCInstPrinter> Printer(
+ T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI));
+ #elif HAVE_LLVM >= 0x0208
+diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+index fe7616b..68f8808 100644
+--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+@@ -62,7 +62,11 @@
+ extern "C" void
+ lp_register_oprofile_jit_event_listener(LLVMExecutionEngineRef EE)
+ {
++#if HAVE_LLVM >= 0x0301
++ llvm::unwrap(EE)->RegisterJITEventListener(llvm::JITEventListener::createOProfileJITEventListener());
++#else
+ llvm::unwrap(EE)->RegisterJITEventListener(llvm::createOProfileJITEventListener());
++#endif
+ }

Generated by cgit