beignet: patch and unbreak + build for llvm-9.0.0
This commit is contained in:
parent
9b48eb5147
commit
af749fc870
|
@ -0,0 +1,56 @@
|
|||
From 75c152599a7c1739e6dadcdb9b377acf7e44d9cf Mon Sep 17 00:00:00 2001
|
||||
From: Jan Beich <jbeich@FreeBSD.org>
|
||||
Date: Wed, 30 Jan 2019 12:42:34 +0000
|
||||
Subject: [PATCH] lang/beignet: unbreak with llvm80
|
||||
|
||||
Regressed by https://github.com/llvm/llvm-project/commit/721d95713a9e
|
||||
|
||||
unable to load /usr/local/lib/beignet//libgbeinterp.so which is part of the driver, please check!
|
||||
ld-elf.so.1: /usr/local/lib/beignet//libgbeinterp.so: Undefined symbol "_ZN4llvm24DisableABIBreakingChecksE"
|
||||
|
||||
Regressed by https://github.com/llvm/llvm-project/commit/4a2d58e16acc
|
||||
|
||||
backend/src/llvm/llvm_gen_backend.cpp:3076:5: error:
|
||||
unknown type name 'TerminatorInst'
|
||||
TerminatorInst *term = bb->getTerminator();
|
||||
^
|
||||
backend/src/llvm/llvm_gen_backend.cpp:3083:5: error:
|
||||
unknown type name 'TerminatorInst'
|
||||
TerminatorInst *term = bb->getTerminator();
|
||||
^
|
||||
|
||||
--- backend/src/CMakeLists.txt.orig 2017-09-22 08:05:22 UTC
|
||||
+++ backend/src/CMakeLists.txt
|
||||
@@ -168,6 +168,7 @@ add_dependencies(gbe beignet_bitcode)
|
||||
endif (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
|
||||
|
||||
add_library(gbeinterp SHARED gbe_bin_interpreter.cpp)
|
||||
+target_link_libraries(gbeinterp ${LLVM_MODULE_LIBS})
|
||||
|
||||
if (LLVM_VERSION_NODOT VERSION_EQUAL 34)
|
||||
find_library(TERMINFO NAMES tinfo ncurses)
|
||||
--- backend/src/llvm/llvm_gen_backend.cpp.orig 2017-10-24 06:04:48 UTC
|
||||
+++ backend/src/llvm/llvm_gen_backend.cpp
|
||||
@@ -3073,14 +3073,22 @@ namespace gbe
|
||||
|
||||
|
||||
static unsigned getChildNo(BasicBlock *bb) {
|
||||
+#if LLVM_VERSION_MAJOR < 8
|
||||
TerminatorInst *term = bb->getTerminator();
|
||||
+#else
|
||||
+ Instruction *term = bb->getTerminator();
|
||||
+#endif
|
||||
return term->getNumSuccessors();
|
||||
}
|
||||
|
||||
// return NULL if index out-range of children number
|
||||
static BasicBlock *getChildPossible(BasicBlock *bb, unsigned index) {
|
||||
|
||||
+#if LLVM_VERSION_MAJOR < 8
|
||||
TerminatorInst *term = bb->getTerminator();
|
||||
+#else
|
||||
+ Instruction *term = bb->getTerminator();
|
||||
+#endif
|
||||
unsigned childNo = term->getNumSuccessors();
|
||||
BasicBlock *child = NULL;
|
||||
if(index < childNo) {
|
|
@ -0,0 +1,111 @@
|
|||
Source: FreeBSD + q66
|
||||
|
||||
Mostly FreeBSD other than FindLLVM.cmake changes.
|
||||
Linking against clang-cpp does not work for us.
|
||||
|
||||
--- CMake/FindLLVM.cmake
|
||||
+++ CMake/FindLLVM.cmake
|
||||
@@ -140,6 +140,7 @@ add_one_lib("clangStaticAnalyzerCore")
|
||||
add_one_lib("clangAnalysis")
|
||||
add_one_lib("clangEdit")
|
||||
add_one_lib("clangAST")
|
||||
+add_one_lib("clangASTMatchers")
|
||||
add_one_lib("clangParse")
|
||||
add_one_lib("clangSema")
|
||||
add_one_lib("clangLex")
|
||||
--- backend/src/llvm/llvm_intrinsic_lowering.cpp.orig 2017-10-24 06:04:48 UTC
|
||||
+++ backend/src/llvm/llvm_intrinsic_lowering.cpp
|
||||
@@ -77,7 +77,11 @@ namespace gbe {
|
||||
std::vector<Type *> ParamTys;
|
||||
for (Value** I = ArgBegin; I != ArgEnd; ++I)
|
||||
ParamTys.push_back((*I)->getType());
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ FunctionCallee FCache = M->getOrInsertFunction(NewFn,
|
||||
+#else
|
||||
Constant* FCache = M->getOrInsertFunction(NewFn,
|
||||
+#endif
|
||||
FunctionType::get(RetTy, ParamTys, false));
|
||||
|
||||
IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
|
||||
--- backend/src/llvm/llvm_sampler_fix.cpp.orig 2017-10-24 06:04:48 UTC
|
||||
+++ backend/src/llvm/llvm_sampler_fix.cpp
|
||||
@@ -82,7 +82,11 @@ namespace gbe {
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
||||
Module *M = I->getParent()->getParent()->getParent();
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
||||
+#else
|
||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
||||
+#endif
|
||||
#else
|
||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
|
||||
#endif
|
||||
@@ -124,7 +128,11 @@ namespace gbe {
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 40
|
||||
Module *M = I->getParent()->getParent()->getParent();
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ FunctionCallee samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
||||
+#else
|
||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType());
|
||||
+#endif
|
||||
#else
|
||||
Value* samplerCvt = M->getOrInsertFunction("__gen_ocl_sampler_to_int", i32Ty, I->getOperand(0)->getType(), nullptr);
|
||||
#endif
|
||||
--- backend/src/llvm/llvm_profiling.cpp.orig 2017-10-24 06:04:48 UTC
|
||||
+++ backend/src/llvm/llvm_profiling.cpp
|
||||
@@ -163,10 +163,18 @@ namespace gbe
|
||||
// __gen_ocl_store_timestamp(int nth, int type);
|
||||
Value *Args[2] = {ConstantInt::get(intTy, pointNum++), ConstantInt::get(intTy, profilingType)};
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ builder->CreateCall(module->getOrInsertFunction(
|
||||
+#else
|
||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
||||
+#endif
|
||||
"__gen_ocl_calc_timestamp", Type::getVoidTy(module->getContext()),
|
||||
IntegerType::getInt32Ty(module->getContext()),
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ IntegerType::getInt32Ty(module->getContext())),
|
||||
+#else
|
||||
IntegerType::getInt32Ty(module->getContext()))),
|
||||
+#endif
|
||||
ArrayRef<Value*>(Args));
|
||||
#else
|
||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
||||
@@ -185,10 +193,18 @@ namespace gbe
|
||||
Value *Args2[2] = {profilingBuf, ConstantInt::get(intTy, profilingType)};
|
||||
|
||||
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 50
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ builder->CreateCall(module->getOrInsertFunction(
|
||||
+#else
|
||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
||||
+#endif
|
||||
"__gen_ocl_store_profiling", Type::getVoidTy(module->getContext()),
|
||||
ptrTy,
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ IntegerType::getInt32Ty(module->getContext())),
|
||||
+#else
|
||||
IntegerType::getInt32Ty(module->getContext()))),
|
||||
+#endif
|
||||
ArrayRef<Value*>(Args2));
|
||||
#else
|
||||
builder->CreateCall(cast<llvm::Function>(module->getOrInsertFunction(
|
||||
--- backend/src/llvm/llvm_device_enqueue.cpp.orig 2017-10-24 06:04:48 UTC
|
||||
+++ backend/src/llvm/llvm_device_enqueue.cpp
|
||||
@@ -398,8 +398,13 @@ namespace gbe {
|
||||
std::vector<Type *> ParamTys;
|
||||
for (Value** iter = args.begin(); iter != args.end(); ++iter)
|
||||
ParamTys.push_back((*iter)->getType());
|
||||
+#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 90
|
||||
+ CallInst* newCI = builder.CreateCall(mod->getOrInsertFunction(
|
||||
+ "__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false)), args);
|
||||
+#else
|
||||
CallInst* newCI = builder.CreateCall(cast<llvm::Function>(mod->getOrInsertFunction(
|
||||
"__gen_enqueue_kernel_slm", FunctionType::get(intTy, ParamTys, false))), args);
|
||||
+#endif
|
||||
CI->replaceAllUsesWith(newCI);
|
||||
deadInsnSet.insert(CI);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'beignet'
|
||||
pkgname=beignet
|
||||
version=1.3.2
|
||||
revision=4
|
||||
revision=5
|
||||
archs="i686* x86_64*"
|
||||
wrksrc="Beignet-${version}-Source"
|
||||
build_style=cmake
|
||||
|
@ -14,7 +14,6 @@ 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="Doesn't build against libLLVM8; can't be built against libclang 8 and libLLVM7"
|
||||
|
||||
post_install() {
|
||||
# remove CL headers, we do use opencl-headers instead.
|
||||
|
|
Loading…
Reference in New Issue