From 990b229364cf9eaf401ee17cbd8d6c4981d522eb Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 14 Nov 2021 18:45:26 +0100 Subject: extra/llvm12: added shim (for rust) --- extra/llvm12/PKGBUILD | 118 +++++++++++++++++++++ extra/llvm12/add-fno-semantic-interposition.patch | Bin 0 -> 1127 bytes extra/llvm12/disable-bswap-for-spir.patch | Bin 0 -> 2285 bytes .../don-t-accept-nullptr-as-GEP-element-type.patch | Bin 0 -> 2858 bytes extra/llvm12/llvm-config.h | 9 ++ .../llvm-link-with-Bsymbolic-functions.patch | Bin 0 -> 3341 bytes .../no-strict-aliasing-DwarfCompileUnit.patch | Bin 0 -> 516 bytes extra/llvm12/x86-twist-shuffle-mask.patch | Bin 0 -> 5960 bytes 8 files changed, 127 insertions(+) create mode 100644 extra/llvm12/PKGBUILD create mode 100644 extra/llvm12/add-fno-semantic-interposition.patch create mode 100644 extra/llvm12/disable-bswap-for-spir.patch create mode 100644 extra/llvm12/don-t-accept-nullptr-as-GEP-element-type.patch create mode 100644 extra/llvm12/llvm-config.h create mode 100644 extra/llvm12/llvm-link-with-Bsymbolic-functions.patch create mode 100644 extra/llvm12/no-strict-aliasing-DwarfCompileUnit.patch create mode 100644 extra/llvm12/x86-twist-shuffle-mask.patch diff --git a/extra/llvm12/PKGBUILD b/extra/llvm12/PKGBUILD new file mode 100644 index 00000000..873fe482 --- /dev/null +++ b/extra/llvm12/PKGBUILD @@ -0,0 +1,118 @@ +# Maintainer: Evangelos Foutras +# Contributor: Jan "heftig" Steffens +# Changed for Archlinux32: Andreas Baumann + +pkgname=('llvm12' 'llvm12-libs') +pkgver=12.0.1 +pkgrel=1 +_ocaml_ver=4.12.0 +arch=(i486 i686 pentium4 'x86_64') +url="https://llvm.org/" +license=('custom:Apache 2.0 with LLVM Exception') +makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2' + 'python-setuptools') +options=('staticlibs') +_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver +source=($_source_base/llvm-$pkgver.src.tar.xz{,.sig} + llvm-link-with-Bsymbolic-functions.patch + add-fno-semantic-interposition.patch + x86-twist-shuffle-mask.patch + no-strict-aliasing-DwarfCompileUnit.patch + llvm-config.h) +sha256sums=('7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf' + 'SKIP' + '560ce1e206c19f4b86f4c583b743db0ad47a610418999350710aafd60ae50fcd' + '989f7359ce1be2437e45d381e73d277bcfcabd72feb1013eb582290d47a37566' + 'c51b8754f76eb3774f46d530409f6d89f5bb47d90f0d718dbfa861f716b29693' + 'd1eff24508e35aae6c26a943dbaa3ef5acb60a145b008fd1ef9ac6f6c4faa662' + '597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48') +validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg +validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard + +prepare() { + cd "$srcdir/llvm-$pkgver.src" + mkdir build + + # https://bugs.archlinux.org/task/70697 + patch -Np2 -i ../llvm-link-with-Bsymbolic-functions.patch + # https://reviews.llvm.org/D102453 + patch -Np2 -i ../add-fno-semantic-interposition.patch + + # https://bugs.llvm.org/show_bug.cgi?id=50823 + patch -Np2 -i ../x86-twist-shuffle-mask.patch + + # Work around intermittent 'clang -O -g' crashes + # https://bugs.llvm.org/show_bug.cgi?id=50611#c3 + patch -Np2 -i ../no-strict-aliasing-DwarfCompileUnit.patch +} + +build() { + cd "$srcdir/llvm-$pkgver.src/build" + + cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLLVM_HOST_TRIPLE=$CHOST \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_INSTALL_UTILS=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_BUILD_TESTS=ON \ + -DLLVM_BINUTILS_INCDIR=/usr/include + ninja all +} + +check() { + cd "$srcdir/llvm-$pkgver.src/build" + ninja check +} + +package_llvm12() { + pkgdesc="Collection of modular and reusable compiler and toolchain technologies" + depends=('llvm12-libs' 'perl') + conflicts=('llvm') + + cd "$srcdir/llvm-$pkgver.src/build" + + DESTDIR="$pkgdir" ninja install + + # Include lit for running lit-based tests in other projects + pushd ../utils/lit + python3 setup.py install --root="$pkgdir" -O1 + popd + + # The runtime libraries go into llvm-libs + mv -f "$pkgdir"/usr/lib/lib{LLVM,LTO,Remarks}*.so* "$srcdir" + mv -f "$pkgdir"/usr/lib/LLVMgold.so "$srcdir" + + install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +package_llvm12-libs() { + pkgdesc="LLVM 12 runtime libraries" + depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2') + + install -d "$pkgdir/usr/lib" + cp -P \ + "$srcdir"/lib{LLVM,LTO,Remarks}*.so* \ + "$srcdir"/LLVMgold.so \ + "$pkgdir/usr/lib/" + + # Remove development symlinks + rm -f "$pkgdir"/usr/lib/lib{LLVM,LTO,Remarks}.so \ + "$pkgdir"/usr/lib/LLVMgold.so + + install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +# vim:set ts=2 sw=2 et: +# ignore failing errors in now (LLVM :: tools/gold/X86/linkonce_odr_unnamed_addr.ll) + +eval "$( + declare -f check | \ + sed ' + s/ninja check/ninja check || true/ + ' +)" diff --git a/extra/llvm12/add-fno-semantic-interposition.patch b/extra/llvm12/add-fno-semantic-interposition.patch new file mode 100644 index 00000000..9edd3671 Binary files /dev/null and b/extra/llvm12/add-fno-semantic-interposition.patch differ diff --git a/extra/llvm12/disable-bswap-for-spir.patch b/extra/llvm12/disable-bswap-for-spir.patch new file mode 100644 index 00000000..11385011 Binary files /dev/null and b/extra/llvm12/disable-bswap-for-spir.patch differ diff --git a/extra/llvm12/don-t-accept-nullptr-as-GEP-element-type.patch b/extra/llvm12/don-t-accept-nullptr-as-GEP-element-type.patch new file mode 100644 index 00000000..28ab9cbe Binary files /dev/null and b/extra/llvm12/don-t-accept-nullptr-as-GEP-element-type.patch differ diff --git a/extra/llvm12/llvm-config.h b/extra/llvm12/llvm-config.h new file mode 100644 index 00000000..2fa08c9b --- /dev/null +++ b/extra/llvm12/llvm-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "llvm-config-32.h" +#elif __WORDSIZE == 64 +#include "llvm-config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/extra/llvm12/llvm-link-with-Bsymbolic-functions.patch b/extra/llvm12/llvm-link-with-Bsymbolic-functions.patch new file mode 100644 index 00000000..b8e2e40e Binary files /dev/null and b/extra/llvm12/llvm-link-with-Bsymbolic-functions.patch differ diff --git a/extra/llvm12/no-strict-aliasing-DwarfCompileUnit.patch b/extra/llvm12/no-strict-aliasing-DwarfCompileUnit.patch new file mode 100644 index 00000000..c7168869 Binary files /dev/null and b/extra/llvm12/no-strict-aliasing-DwarfCompileUnit.patch differ diff --git a/extra/llvm12/x86-twist-shuffle-mask.patch b/extra/llvm12/x86-twist-shuffle-mask.patch new file mode 100644 index 00000000..a868237b Binary files /dev/null and b/extra/llvm12/x86-twist-shuffle-mask.patch differ -- cgit v1.2.3-54-g00ecf