aboutsummaryrefslogtreecommitdiffstats
path: root/community/lld/APKBUILD
blob: 7d59deed9881e9e8c67fcc28b7a5f8193f74056a (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
# Contributor: Eric Molitor <eric@molitor.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=lld
pkgver=9.0.1
pkgrel=1
_llvmver=${pkgver%%.*}
pkgdesc="The LLVM Linker"
url="https://llvm.org"
arch="all"
license="Apache-2.0"
makedepends="
	cmake
	libedit-dev
	llvm-dev>=$_llvmver
	llvm-static>=$_llvmver
	llvm-test-utils=>$_llvmver
	zlib-dev"
checkdepends="gtest gtest-dev bash"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/lld-$pkgver.src.tar.xz"
builddir="$srcdir/$pkgname-$pkgver.src"

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build

	cmake .. \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_VERBOSE_MAKEFILE=OFF \
		-DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
		-DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS -fpermissive" \
		-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS -Wl,-z,stack-size=2097152" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DLLVM_INCLUDE_TESTS=ON
	make
}

check() {
	cd "$builddir/build"

	# ELF/eh-frame-hdr-augmentation.s is broken on armhf & armv7
	case "$CARCH" in
		armhf|armv7) rm ../test/ELF/eh-frame-hdr-augmentation.s;;
	esac

	# make check-lld doesn't like using system lit
	lit -sv \
		--param lld_site_config=$builddir/build/test/lit.site.cfg \
		--param lld_unit_site_config=$builddir/build/test/Unit/lit.site.cfg \
		$builddir/build/test

}

package() {
	cd "$builddir"/build

	make install DESTDIR="$pkgdir"
}

sha512sums="ca57d1a5fc2e39c002e061dc8278a721df8493d4c05c2275fe32b626258362563b82113b51bbaa454815d8ac0440078803f866444a8788aaca4816d7463ed430  lld-9.0.1.src.tar.xz"