beignet: fix llvm6 build.

Closes: #12747 [via git-merge-pr]
This commit is contained in:
maxice8 2018-03-21 07:41:58 -03:00 committed by Michael Aldridge
parent 5e510a1737
commit 4562bcf13e
3 changed files with 48 additions and 7 deletions

View file

@ -0,0 +1,33 @@
Source: Arch Linux
Upstream: unknown
Reason: fixes llvm6 compilation
--- backend/src/llvm/llvm_to_gen.cpp 2017-10-24 09:04:48.000000000 +0300
+++ backend/src/llvm/llvm_to_gen.cpp 2018-03-16 16:08:54.669963824 +0200
@@ -322,7 +322,11 @@ namespace gbe
DataLayout DL(&mod);
gbeDiagnosticContext dc;
+#if LLVM_VERSION_MAJOR >= 6
+ mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
+#else
mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
+#endif
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
mod.setDataLayout(DL);
--- backend/src/llvm/llvm_unroll.cpp 2017-10-24 09:04:48.000000000 +0300
+++ backend/src/llvm/llvm_unroll.cpp 2018-03-16 16:09:47.736403557 +0200
@@ -205,7 +205,9 @@ namespace gbe {
if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
//Don't change the unrollID if doesn't force unroll.
//setUnrollID(parentL, false);
-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
+#if LLVM_VERSION_MAJOR >= 6
+ loopInfo.erase(parentL);
+#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
loopInfo.markAsRemoved(parentL);
#else
LPM.deleteLoopFromQueue(parentL);
Only in Beignet-1.3.2-Source: build

View file

@ -0,0 +1,11 @@
--- backend/src/backend/gen/gen_mesa_disasm.c
+++ backend/src/backend/gen/gen_mesa_disasm.c
@@ -1137,7 +1137,7 @@ static uint32_t __conv_half_to_float(uint16_t h)
// Adjust mantissa so it's normalized (and keep
// track of exponent adjustment)
int e = -1;
- uint m = i.mantissa;
+ unsigned int m = i.mantissa;
do {
e++;
m <<= 1;

View file

@ -1,23 +1,20 @@
# Template file for 'beignet'
pkgname=beignet
version=1.3.2
revision=2
revision=3
wrksrc="Beignet-${version}-Source"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
build_style=cmake
hostmakedepends="llvm pkg-config clang"
makedepends="zlib-devel libffi-devel libedit-devel ncurses-devel libXext-devel
libXfixes-devel libdrm-devel MesaLib-devel ocl-icd-devel"
hostmakedepends="clang llvm pkg-config"
makedepends="MesaLib-devel libedit-devel libffi-devel ocl-icd-devel zlib-devel"
short_desc="The Beignet GPGPU System for Intel GPUs"
depends="ocl-icd"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="LGPL-2.1"
license="LGPL-2.1-or-later"
homepage="http://www.freedesktop.org/wiki/Software/Beignet/"
distfiles="https://01.org/sites/default/files/${pkgname}-${version}-source.tar.gz"
checksum=c555edba149de23243965a703f39f79fa06f15bcff5a3762b5544b0925010b43
broken="fails to build on llvm6, setDiagnosticHandler() on llvm backend"
post_install() {
# remove CL headers, we do use opencl-headers instead.
rm -r ${DESTDIR}/usr/include