blob: f56cffde8e1f36ad4500253538e58e06ce15df6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# Contributor Travis Tilley <ttilley@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=compiler-rt
# Note: Update together with llvm.
pkgver=7.0.1
pkgrel=0
_llvmver=${pkgver%%.*}
pkgdesc="LLVM compiler-rt runtime libraries"
arch="aarch64 x86 x86_64"
url="https://llvm.org/"
license="NCSA"
makedepends="
cmake
linux-headers
clang
llvm-dev>=$_llvmver
llvm-static>=$_llvmver
ninja
python3
"
checkdepends="llvm-test-utils>=$_llvmver"
source="https://releases.llvm.org/$pkgver/$pkgname-$pkgver.src.tar.xz
disable-sanitizers.patch"
builddir="$srcdir/$pkgname-$pkgver.src"
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
# compiler-rt uses llvm intrinsic types for testing
# and therefore requires clang
cmake .. \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
\
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
-DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
\
-DCOMPILER_RT_INCLUDE_TESTS=ON \
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DLLVM_EXTERNAL_LIT="/usr/bin/lit" \
-G Ninja
ninja
}
check() {
cd "$builddir"/build
# remove test that does not work with PaX kernel
rm ../test/builtins/Unit/enable_execute_stack_test.c \
../test/builtins/Unit/clear_cache_test.c
ninja check-compiler-rt || true # FIXME: figure out why tests fails
}
package() {
cd "$builddir"/build
DESTDIR="$pkgdir" ninja install
cd "$pkgdir"
mkdir -p usr/lib/clang
case "$CARCH" in
ppc64le | s390x) ;;
*) mv usr/lib/linux usr/lib/clang/$pkgver;;
esac
}
sha512sums="b94a2a1fb9a6d587cef59b04b951628747bb35bdbcb67de8825aad402a2ba875916a347eef7a9575ac27264e8372e2d67cd477fe2d750c0ed3ce7d67bbbc7dba compiler-rt-7.0.1.src.tar.xz
9d07c71cd9d3d827ae0663c971ca07f3034499d01013de2c68be2d0905b92a40da309247602bd45328c2e4cb6db382952724e56301330ab128e6a80a89fbb676 disable-sanitizers.patch"
|