diff --git a/main/llvm10/APKBUILD b/main/llvm10/APKBUILD index 83c470e3917f3fd15c413c4ebcd6857ffc6149df..d97c849503a3df2382ed510f9d86e28c2a2c23a6 100644 --- a/main/llvm10/APKBUILD +++ b/main/llvm10/APKBUILD @@ -3,6 +3,7 @@ # Contributor: Travis Tilley <ttilley@gmail.com> # Contributor: Mitch Tishmack <mitch.tishmack@gmail.com> # Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Contributor: Ariadne Conill <ariadne@dereferenced.org> # Maintainer: Rasmus Thomsen <oss@cogitri.dev> _pkgname=llvm pkgver=10.0.1 @@ -14,8 +15,8 @@ arch="all" url="https://llvm.org/" license="Apache-2.0" depends_dev="$pkgname=$pkgver-r$pkgrel" -makedepends="binutils-dev chrpath cmake libffi-dev python3 zlib-dev - libxml2-dev py3-setuptools" +makedepends_host="binutils-dev libffi-dev zlib-dev libxml2-dev" +makedepends_build="cmake chrpath python3 py3-setuptools" # diffutils for diff: unrecognized option: strip-trailing-cr # coreutils for 'od' binary checkdepends="bash coreutils diffutils" @@ -28,6 +29,15 @@ source="https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/l " builddir="$srcdir/$_pkgname-$pkgver.src" +# If crosscompiling, we need llvm-tblgen on the build machine. +if [ -n "$BOOTSTRAP" ]; then + makedepends_build="$makedepends_build cmd:llvm-tblgen" + cmake_cross_options=" + -DCMAKE_CROSSCOMPILING=ON + -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen + " +fi + # ARM has few failures in test suite that we don't care about currently and # also it takes forever to run them on the builder. # MIPS as well... @@ -105,6 +115,7 @@ build() { -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_APPEND_VC_REV=OFF \ + $cmake_cross_options \ "$builddir" make llvm-tblgen