Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/llvm12/PKGBUILD
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-11-14 18:45:26 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2021-11-14 18:45:26 +0100
commit990b229364cf9eaf401ee17cbd8d6c4981d522eb (patch)
treee55e83b315256a771f51908cf0ec0c95f87d6fcf /extra/llvm12/PKGBUILD
parentc205ac4aa24e1241bf2905aa82ffe600502a59e6 (diff)
extra/llvm12: added shim (for rust)
Diffstat (limited to 'extra/llvm12/PKGBUILD')
-rw-r--r--extra/llvm12/PKGBUILD118
1 files changed, 118 insertions, 0 deletions
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 <evangelos@foutrelis.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
+# Changed for Archlinux32: Andreas Baumann <mail@andreasbaumann.cc>
+
+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 <hans@chromium.org>
+validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com>
+
+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/
+ '
+)"