llvmlite: Update to 0.37.0rc1 and try to make it work with llvm 12

the rc1 fixes llvm 11 support, and my patch makes it build with 12, but not tested.
This commit is contained in:
Christoph Reiter
2021-07-14 19:58:29 +02:00
parent 1a53d71682
commit d81fc1f2bb
3 changed files with 22 additions and 41 deletions

View File

@@ -6,14 +6,16 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.36.0
pkgrel=2
pkgver=0.37.0rc1
pkgrel=1
pkgdesc='Lightweight LLVM python binding for writing JIT compilers (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://github.com/numba/llvmlite"
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-polly>=10.0.1")
depends=(
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-polly>=10.0.1")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-cython"
"${MINGW_PACKAGE_PREFIX}-cmake")
@@ -21,19 +23,19 @@ options=('!emptydirs' 'staticlibs' 'strip')
source=(llvmlite-$pkgver.tar.gz::"https://github.com/numba/llvmlite/archive/v$pkgver.tar.gz"
"multi-defs.patch"
"path_fix.patch"
"llvm-11.0.patch")
sha256sums=('084dcde3831def454b938e4c28eaaa65162e9f7b28110bdcb1727010f6b8f532'
"llvm-12.0.patch")
sha256sums=('f63f6fc16218f3eeab515d8265bda63f254c0d5595214be14757165810d95602'
'b4610934ac8fd7e614d9ea920856ff6da2fbeb146028a664ada8543b8b33ec56'
'813ecc48f18543f0d36b03c7596a1a6a26be31b9cfa44f1111ac232821844a79'
'5313db3353a18b08fdaa2032c244a8848a1945e4c88f26fcc37ce1f30b96f173')
'ff31146ec66374b77d37528c13178e73bc8e92227b8919ed715963cc81bf5ed9')
prepare() {
cd "$srcdir/${_realname}-${pkgver}"
patch -p1 -i "${srcdir}/multi-defs.patch"
patch -p1 -i "${srcdir}/path_fix.patch"
# https://github.com/msys2/MINGW-packages/discussions/8386
patch -p1 -i "${srcdir}/llvm-11.0.patch"
patch -p1 -i "${srcdir}/llvm-12.0.patch"
sed -i "s,_MSC_VER,_WIN32," ffi/core.h
}

View File

@@ -1,33 +0,0 @@
diff -Naur llvmlite-0.36.0.a/ffi/custom_passes.cpp llvmlite-0.36.0.b/ffi/custom_passes.cpp
--- llvmlite-0.36.0.a/ffi/custom_passes.cpp 2021-03-11 17:54:55.000000000 +0100
+++ llvmlite-0.36.0.b/ffi/custom_passes.cpp 2021-03-30 12:25:43.415085100 +0200
@@ -400,7 +400,7 @@
// LLVM 9 postdomtree.dominates takes basic blocks
if ( domtree.dominates(incref, decref)
&& postdomtree.dominates(decref->getParent(), incref->getParent()) ){
-#elif LLVM_VERSION_MAJOR == 10
+#elif LLVM_VERSION_MAJOR == 11
// LLVM 10 postdomtree.dominates can handle instructions
if ( domtree.dominates(incref, decref)
&& postdomtree.dominates(decref, incref) ){
diff -Naur llvmlite-0.36.0.a/ffi/transforms.cpp llvmlite-0.36.0.b/ffi/transforms.cpp
--- llvmlite-0.36.0.a/ffi/transforms.cpp 2021-03-11 17:54:55.000000000 +0100
+++ llvmlite-0.36.0.b/ffi/transforms.cpp 2021-03-30 12:26:12.121988800 +0200
@@ -5,7 +5,7 @@
extern "C" {
-
+/*
namespace llvm {
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
return reinterpret_cast<PassManagerBuilder*>(P);
@@ -15,7 +15,7 @@
return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
}
}
-
+*/
API_EXPORT(LLVMPassManagerBuilderRef)
LLVMPY_PassManagerBuilderCreate()

View File

@@ -0,0 +1,12 @@
--- llvmlite-0.37.0rc1/ffi/targets.cpp.orig 2021-07-14 19:53:41.961000000 +0200
+++ llvmlite-0.37.0rc1/ffi/targets.cpp 2021-07-14 19:53:45.753000000 +0200
@@ -232,7 +232,8 @@
rm = Reloc::DynamicNoPIC;
TargetOptions opt;
- opt.PrintMachineCode = PrintMC;
+ // Removed in https://github.com/llvm/llvm-project/commit/589c646a7e5fb03223340476f7ffb67fd9628726
+ //opt.PrintMachineCode = PrintMC;
bool jit = JIT;