1 # Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
2 # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
4 pkgname=('llvm13' 'llvm13-libs')
8 url="https://llvm.org/"
9 license=('custom:Apache 2.0 with LLVM Exception')
10 makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
12 options=('staticlibs' '!lto') # Getting thousands of test failures with LTO
13 _source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
14 source=($_source_base/llvm-$pkgver.src.tar.xz{,.sig}
15 don-t-accept-nullptr-as-GEP-element-type.patch
16 don-t-override-__attribute__-no_stack_protector.patch
17 don-t-move-DBG_VALUE-instructions.patch
18 disable-A-B-A-B-and-BSWAP-in-InstCombine.patch
19 disable-DIArgList-in-SPIR-V.patch)
20 sha256sums=('ec6b80d82c384acad2dc192903a6cf2cdbaffb889b84bfb98da9d71e630fc834'
22 'a7e902a7612d0fdabe436a917468b043cc296bc89d8954bfc3126f737beb9ac4'
23 '9f0a4578b94eb8853b83af2f65e92705254b4b56d96f9a941714d174b932f465'
24 'f7d69f84241416398fdb3df8bb44f9fae3c49d89889c7ffa3b37aa2e9d78f708'
25 '34cc0d79a30599cb2287b47b4e9a1a5bf03d57a1f8bb35be3fe976ffc4a604f6'
26 '8642da2d556092e4284873ba6ddc6c9a67841f42cc16f923bcd523e4b304a3ff')
27 validpgpkeys=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com>
33 # https://github.com/intel/intel-graphics-compiler/issues/204
34 patch -Rp2 -i ../don-t-accept-nullptr-as-GEP-element-type.patch
36 # Fixes Chromium error "*** stack smashing detected ***: terminated"
37 # (which also goes away with "--change-stack-guard-on-fork=disabled")
38 # https://reviews.llvm.org/D116589
39 patch -Np2 -i ../don-t-override-__attribute__-no_stack_protector.patch
41 # https://github.com/llvm/llvm-project/issues/53243
42 # https://github.com/rust-lang/rust/issues/92869
43 patch -Np2 -i ../don-t-move-DBG_VALUE-instructions.patch
45 # Patches needed for ISPC for Xe only
46 patch -Np2 -i ../disable-A-B-A-B-and-BSWAP-in-InstCombine.patch
47 patch -Np2 -i ../disable-DIArgList-in-SPIR-V.patch
51 cd llvm-$pkgver.src/build
55 -DCMAKE_BUILD_TYPE=Release
56 -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm13
58 -DLLVM_BINUTILS_INCDIR=/usr/include
59 -DLLVM_BUILD_LLVM_DYLIB=ON
61 -DLLVM_ENABLE_BINDINGS=OFF
64 -DLLVM_HOST_TRIPLE=$CHOST
65 -DLLVM_INSTALL_UTILS=ON
66 -DLLVM_LINK_LLVM_DYLIB=ON
68 cmake .. "${cmake_args[@]}"
73 cd llvm-$pkgver.src/build
74 LD_LIBRARY_PATH=$PWD/lib ninja check
78 pkgdesc="Compiler infrastructure (LLVM 13)"
79 depends=('llvm13-libs' 'perl')
81 cd llvm-$pkgver.src/build
83 DESTDIR="$pkgdir" ninja install
85 # The runtime libraries go into llvm13-libs
86 mv -f "$pkgdir"/usr/lib/llvm13/lib/libLLVM-{13,$pkgver}.so "$srcdir/"
87 mv -f "$pkgdir"/usr/lib/llvm13/lib/LLVMgold.so "$srcdir/"
89 install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
92 package_llvm13-libs() {
93 pkgdesc="LLVM 13 runtime libraries"
94 depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2')
96 install -d "$pkgdir/usr/lib/llvm13/lib"
97 cp -P "$srcdir"/libLLVM-{13,$pkgver}.so "$pkgdir/usr/lib/"
98 ln -s ../../libLLVM-13.so "$pkgdir/usr/lib/llvm13/lib/libLLVM-13.so"
99 ln -s ../../libLLVM-13.so "$pkgdir/usr/lib/llvm13/lib/libLLVM-$pkgver.so"
100 cp -P "$srcdir"/LLVMgold.so "$pkgdir/usr/lib/llvm13/lib/"
102 install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \
103 "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
106 # vim:set ts=2 sw=2 et: