beignet-1.3.2-llvm8-support.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 75c152599a7c1739e6dadcdb9b377acf7e44d9cf Mon Sep 17 00:00:00 2001
  2. From: Jan Beich <jbeich@FreeBSD.org>
  3. Date: Wed, 30 Jan 2019 12:42:34 +0000
  4. Subject: [PATCH] lang/beignet: unbreak with llvm80
  5. Regressed by https://github.com/llvm/llvm-project/commit/721d95713a9e
  6. unable to load /usr/local/lib/beignet//libgbeinterp.so which is part of the driver, please check!
  7. ld-elf.so.1: /usr/local/lib/beignet//libgbeinterp.so: Undefined symbol "_ZN4llvm24DisableABIBreakingChecksE"
  8. Regressed by https://github.com/llvm/llvm-project/commit/4a2d58e16acc
  9. backend/src/llvm/llvm_gen_backend.cpp:3076:5: error:
  10. unknown type name 'TerminatorInst'
  11. TerminatorInst *term = bb->getTerminator();
  12. ^
  13. backend/src/llvm/llvm_gen_backend.cpp:3083:5: error:
  14. unknown type name 'TerminatorInst'
  15. TerminatorInst *term = bb->getTerminator();
  16. ^
  17. --- a/backend/src/CMakeLists.txt
  18. +++ b/backend/src/CMakeLists.txt
  19. @@ -168,6 +168,7 @@ add_dependencies(gbe beignet_bitcode)
  20. endif (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
  21. add_library(gbeinterp SHARED gbe_bin_interpreter.cpp)
  22. +target_link_libraries(gbeinterp ${LLVM_MODULE_LIBS})
  23. if (LLVM_VERSION_NODOT VERSION_EQUAL 34)
  24. find_library(TERMINFO NAMES tinfo ncurses)
  25. --- a/backend/src/llvm/llvm_gen_backend.cpp
  26. +++ b/backend/src/llvm/llvm_gen_backend.cpp
  27. @@ -3073,14 +3073,22 @@ namespace gbe
  28. static unsigned getChildNo(BasicBlock *bb) {
  29. +#if LLVM_VERSION_MAJOR < 8
  30. TerminatorInst *term = bb->getTerminator();
  31. +#else
  32. + Instruction *term = bb->getTerminator();
  33. +#endif
  34. return term->getNumSuccessors();
  35. }
  36. // return NULL if index out-range of children number
  37. static BasicBlock *getChildPossible(BasicBlock *bb, unsigned index) {
  38. +#if LLVM_VERSION_MAJOR < 8
  39. TerminatorInst *term = bb->getTerminator();
  40. +#else
  41. + Instruction *term = bb->getTerminator();
  42. +#endif
  43. unsigned childNo = term->getNumSuccessors();
  44. BasicBlock *child = NULL;
  45. if(index < childNo) {