mesa: rebuild with LLVM 7

This commit is contained in:
Sergei Reznikov
2019-01-01 05:21:21 +03:00
parent b3998072dd
commit 7b0f3ce4ca
2 changed files with 63 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ providing 3D rendering to Haiku applications."
HOMEPAGE="https://www.mesa3d.org/"
COPYRIGHT="1999-2018 Brian Paul"
LICENSE="MIT"
REVISION="3"
REVISION="4"
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
CHECKSUM_SHA256="cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb"
PATCHES="mesa-$portVersion.patchset"
@@ -55,13 +55,13 @@ PROVIDES_swpipe="
"
REQUIRES_swpipe="
mesa$secondaryArchSuffix == $portVersion base
lib:libLLVM_5.0$secondaryArchSuffix
lib:libLLVM_7$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
devel:libLLVM_5.0$secondaryArchSuffix
devel:libLLVM_7$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
@@ -93,7 +93,7 @@ BUILD()
# for whatever reason, the llvm_require_version function is busted, so we
# manually patch it here
sed -i 's@"\$LLVM_VERSION_MAJOR" -gt "\$llvm_target_version_major"@true@' configure
sed -i 's@-DHAVE_LLVM=0x0\$LLVM_VERSION_INT@-DHAVE_LLVM=0x0500@' configure
sed -i 's@-DHAVE_LLVM=0x0\$LLVM_VERSION_INT@-DHAVE_LLVM=0x0700@' configure
runConfigure ./configure \
--enable-llvm \
--disable-dri \
@@ -126,7 +126,8 @@ INSTALL()
appVersion=${portVersion//\./ }
setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit"
setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL"
setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer"
setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long \
"Gallium LLVM software pipe renderer"
prepareInstalledDevelLibs \
libGL libEGL libOSMesa

View File

@@ -1,4 +1,4 @@
From ec8d0a5d3dffdb41b48d2dd1e83c5a05bad0e95f Mon Sep 17 00:00:00 2001
From bf51cc6f0cc89c0e159e472fd3ce108f28a28cec Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 11 Sep 2017 21:29:14 +0200
Subject: Haiku patch
@@ -509,10 +509,10 @@ index df907ff..9f21a71 100644
* APIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as
* the initial ESP value is saved in the EBP in the function prologue, then
--
2.14.2
2.19.1
From 639a31f891f1a419d876004930fe1560440e3d23 Mon Sep 17 00:00:00 2001
From db58020dc4a527d51ba6884f70172c06c0567064 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Wed, 10 May 2017 17:26:07 +0900
Subject: gallivm: Fix build against LLVM SVN >= r302589
@@ -553,21 +553,18 @@ index 2a388cb..0e4a531 100644
virtual void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure=true) {
--
2.14.2
2.19.1
From a2f886847116e484abe8dbc57001f9403b881ef8 Mon Sep 17 00:00:00 2001
From 5939a7f627d4444ecd144ea1e0fa6b63dda8981b Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Tue, 28 Aug 2018 21:32:38 -0400
Subject: [PATCH] BGLView: Make LockGL recursive.
Subject: BGLView: Make LockGL recursive.
This is the BeOS behavior, and the behavior of TinyGL's BGLView implementation
also. Fixes Flurry and other applications crashing.
Also initialize fRenderer in the constructor.
---
src/hgl/GLView.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp
index 9ae5b5c..9e01dcc 100644
@@ -608,5 +605,55 @@ index 9ae5b5c..9e01dcc 100644
// Jackburton: The following code was commented because it doesn't look
// good in "direct" mode:
--
2.16.4
2.19.1
From 1238627607c5b15d80e1f8a166afd2c0f054309d Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 1 Jan 2019 04:21:25 +0300
Subject: gallivm: Use new LLVM fast-math-flags API
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 0e4a531..768ac74 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -791,7 +791,11 @@ lp_create_builder(LLVMContextRef ctx, enum lp_float_mode float_mode)
llvm::unwrap(builder)->setFastMathFlags(flags);
break;
case LP_FLOAT_MODE_UNSAFE_FP_MATH:
+#if HAVE_LLVM >= 0x0600
+ flags.setFast();
+#else
flags.setUnsafeAlgebra();
+#endif
llvm::unwrap(builder)->setFastMathFlags(flags);
break;
}
--
2.19.1
From 0779209bf54b024b8acbac0b9e32fce67eaa74e5 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 1 Jan 2019 04:25:19 +0300
Subject: gallivm: Fix include for LLVMAddPromoteMemoryToRegisterPass
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 9f1ade6..e53dcb7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -40,6 +40,9 @@
#include <llvm-c/Analysis.h>
#include <llvm-c/Transforms/Scalar.h>
+#if HAVE_LLVM >= 0x0700
+#include <llvm-c/Transforms/Utils.h>
+#endif
#include <llvm-c/BitWriter.h>
--
2.19.1