aboutsummaryrefslogtreecommitdiffstats
path: root/main/compiler-rt/APKBUILD
blob: 8cd1a31c446f97bd849df8d74b9d4c795f513394 (plain) (blame)
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
# Contributor Travis Tilley <ttilley@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=compiler-rt
# Note: Update together with llvm.
pkgver=5.0.2
pkgrel=0
_llvmver=${pkgver%%.*}
pkgdesc="LLVM compiler-rt runtime libraries"
arch="all !ppc64le !s390x !armv7 !armhf"
url="http://llvm.org/"
license="UOI-NCSA"
makedepends="
	cmake
	linux-headers
	clang
	llvm-dev>=$_llvmver
	llvm-static>=$_llvmver
	python2
	"
checkdepends="llvm-test-utils>=$_llvmver"
source="https://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.xz"
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 \
		-DLIT_COMMAND="/usr/bin/lit"
	make
}

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
	make check-compiler-rt
}

package() {
	cd "$builddir"/build

	make DESTDIR="$pkgdir" install

	cd "$pkgdir"

	mkdir -p usr/lib/clang
	case "$CARCH" in
		ppc64le | s390x) ;;
		*) mv usr/lib/linux usr/lib/clang/$pkgver;;
	esac
}

sha512sums="605a6d064877a860d6c9097e0220896dfceafed0a2392ad495c97aa347b97899d89f7e21932e29d3274f396615837414a3e730a915fe4f53eaa858ce3642a666  compiler-rt-5.0.2.src.tar.xz"