diff options
Diffstat (limited to 'main/llvm')
-rw-r--r-- | main/llvm/APKBUILD | 89 | ||||
-rw-r--r-- | main/llvm/llvm-exit-config-when-cbuild-set.patch | 13 |
2 files changed, 52 insertions, 50 deletions
diff --git a/main/llvm/APKBUILD b/main/llvm/APKBUILD index 97f7635226..92366aec1f 100644 --- a/main/llvm/APKBUILD +++ b/main/llvm/APKBUILD @@ -3,7 +3,7 @@ pkgname=llvm pkgver=3.8.1 pkgrel=0 -pkgdesc="low level virtual machine compiler system" +pkgdesc="Low Level Virtual Machine compiler system" arch="all" url="http://llvm.org/" license="UOI-NCSA" @@ -26,41 +26,23 @@ makedepends="$depends_dev python-dev zlib-dev " -install= subpackages="$pkgname-static $pkgname-doc $pkgname-dev $pkgname-libs" -source=" +source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch llvm-0002-Fix-build-with-musl-libc.patch llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch llvm-nm-workaround.patch - - http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz + llvm-exit-config-when-cbuild-set.patch " - -_builddir="$srcdir"/build - -_cmake_common_flags="\ -" - - -_srcdir="$srcdir"/"$pkgname-$pkgver.src" +builddir="$srcdir/$pkgname-$pkgver.src" prepare() { - msg "Patching LLVM core..." - cd "$_srcdir" || return 1 + cd "$builddir" + update_config_sub || return 1 - sed -i -e '/case "\${UNAME_MACHINE}:\${UNAME_SYSTEM}:\${UNAME_RELEASE}:\${UNAME_VERSION}" in/i \' \ - -e 'if [ x != "x$CBUILD" ]; then echo "$CBUILD"; exit; fi' \ - ./autoconf/config.guess || return 1 - for i in $source; do - case $i in - llvm-*.patch) - msg "Applying $i..." - patch -s -p1 -N -i "$srcdir"/$i || return 1 - ;; - esac - done - # remove some tests that fails + default_prepare || return 1 + + # Remove some tests that fails. rm test/tools/llvm-objdump/macho-compact-unwind-x86_64.test \ test/tools/llvm-objdump/macho-compact-unwind-i386.test \ test/Transforms/GlobalOpt/alias-used.ll \ @@ -69,8 +51,8 @@ prepare() { } build() { - mkdir -p "$_builddir" - cd "$_builddir" + mkdir -p "$builddir"/build + cd "$builddir"/build # auto-detect it by guessing either. _ffi_include_dir="$(pkg-config --cflags-only-I libffi | sed 's|^-I||g')" @@ -104,68 +86,75 @@ build() { -DLLVM_TARGETS_TO_BUILD=all \ \ -DSPHINX_WARNINGS_AS_ERRORS=NO \ - "${_srcdir}" || return 1 + "$builddir" || return 1 make llvm-tblgen || return 1 make || return 1 - paxmark m bin/llvm-rtdyld - paxmark m bin/lli - paxmark m bin/lli-child-target - - paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests - paxmark m unittests/Support/SupportTests - + paxmark m bin/llvm-rtdyld \ + bin/lli \ + bin/lli-child-target \ + unittests/ExecutionEngine/MCJIT/MCJITTests \ + unittests/Support/SupportTests || return 1 case "$CARCH" in arm*) # ARM has few failures in test suite - # that we don't care about currently + # that we don't care about currently. ;; *) - make check-llvm || return 1 + make check-llvm || return 1 ;; esac } package() { - cd "$_builddir" - make DESTDIR="$pkgdir" install - file "$pkgdir"/usr/lib/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d - file "$pkgdir"/usr/bin/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d + cd "$builddir"/build + + make DESTDIR="$pkgdir" install || return 1 + + # Remove RPATHs + file "$pkgdir"/lib/*.so "$pkgdir"/bin/* \ + | awk -F: '$2~/ELF/{print $1}' \ + | xargs -r chrpath -d } static() { pkgdesc="LLVM static libraries" + mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/ } dev() { default_dev || return 1 + mv "$pkgdir"/usr/lib/LLVMHello.so "$subpkgdir"/usr/lib/ || return 1 mv "$pkgdir"/usr/share "$subpkgdir"/usr/ || return 1 } libs() { pkgdesc="LLVM runtime libraries" + mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libLLVM-[0-9]*.so* "$subpkgdir"/usr/lib/ } - -md5sums="10904f363abd86c5c4729e5630ea319c llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch +md5sums="538467e6028bbc9259b1e6e015d25845 llvm-3.8.1.src.tar.xz +10904f363abd86c5c4729e5630ea319c llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch b0cd098117223159b76e96c3f884536b llvm-0002-Fix-build-with-musl-libc.patch 9cc5050619f764ca9dc842a5ab122290 llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch 785147afd8ab80fa95955a5637b6582f llvm-nm-workaround.patch -538467e6028bbc9259b1e6e015d25845 llvm-3.8.1.src.tar.xz" -sha256sums="708db2b21570e48e2c2e155a0c7b7969acecbb82393e306b5b69b0353ac108dd llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch +79d98688de62404b6276e3aa2ea01b01 llvm-exit-config-when-cbuild-set.patch" +sha256sums="6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 llvm-3.8.1.src.tar.xz +708db2b21570e48e2c2e155a0c7b7969acecbb82393e306b5b69b0353ac108dd llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch e1b0fd5f6918d8c8404f3ec4b8d3ab8fbe8dadc2d6011792349b56e5e8ee51e2 llvm-0002-Fix-build-with-musl-libc.patch fc28356bf0d5fcfe9b99e28f4abbc2f49f50d263b44e428e30f33bf5472747b4 llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch 1870f910a6f5f2ba6144bd079ec55ed879fe8fd8b1b1b384935f36da43e5f114 llvm-nm-workaround.patch -6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 llvm-3.8.1.src.tar.xz" -sha512sums="a97ad7a71ec4878f1a8a335dbc0c161323d957aeb95917b0c4837405c69b53b5f9718094e0e9fd7814c74f44aaa8cff3a9379202964b537c8162a53214621bc5 llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch +8dca08e97637ae1ce5c99d8a6f7fefec9869ea1cda22fe33fe8ebd0a489d0df3 llvm-exit-config-when-cbuild-set.patch" +sha512sums="99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 llvm-3.8.1.src.tar.xz +a97ad7a71ec4878f1a8a335dbc0c161323d957aeb95917b0c4837405c69b53b5f9718094e0e9fd7814c74f44aaa8cff3a9379202964b537c8162a53214621bc5 llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch 4cb3fabbb627b596ce398ed717c66ad20bbea7092ba30751520cc5a63d38e1ac53d23e98a6ad82121ddcf2434383ba5cadbc2990f99a4528e99c6e2160c2f725 llvm-0002-Fix-build-with-musl-libc.patch 19bfb9282455d39d07dbb2b1293b03a45c57d522fbb9c5e58dac034200669628b97e7a90cd4ff5d52d9bb79acfccbef653d8a1140a7f0589ecd6f9b7c4ba0eb6 llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch 11db6f3c5d697bc536c7d053530f7a5572756185e16399c32c31306861b58046ca9bc14b8d8097758c00a8c1a7026cbfb75636c0e697e59c53dda5848f93b006 llvm-nm-workaround.patch -99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 llvm-3.8.1.src.tar.xz" +7a162897c0014ca7c0415edf8e2ab477c964a451db63a4a9a5852ad58e238da003fca9e821bf3cc130e0684ce03e0f2eee7371f819d5282be82b1876d49c52e4 llvm-exit-config-when-cbuild-set.patch" diff --git a/main/llvm/llvm-exit-config-when-cbuild-set.patch b/main/llvm/llvm-exit-config-when-cbuild-set.patch new file mode 100644 index 0000000000..ffe0fd2f8f --- /dev/null +++ b/main/llvm/llvm-exit-config-when-cbuild-set.patch @@ -0,0 +1,13 @@ +--- a/autoconf/config.guess 2016-08-04 01:13:53.941899947 +0200 ++++ b/autoconf/config.guess 2016-08-04 01:16:30.084553757 +0200 +@@ -142,6 +142,10 @@ + + # Note: order is significant - the case branches are not exclusive. + ++if [ -n "$CBUILD" ]; then ++ echo "ERROR: \$CBUILD is set: $CBUILD"; exit ++fi ++ + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or |