void-packages/srcpkgs/beignet/patches/llvm08.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: convert patches to -Np1
```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

56 lines
2 KiB
Diff

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();
^
--- a/backend/src/CMakeLists.txt 2017-09-22 08:05:22 UTC
+++ b/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)
--- a/backend/src/llvm/llvm_gen_backend.cpp 2017-10-24 06:04:48 UTC
+++ b/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) {