diff options
Diffstat (limited to 'source/d/llvm/llvm.SlackBuild')
-rwxr-xr-x | source/d/llvm/llvm.SlackBuild | 76 |
1 files changed, 23 insertions, 53 deletions
diff --git a/source/d/llvm/llvm.SlackBuild b/source/d/llvm/llvm.SlackBuild index f0626ffa..a8682e35 100755 --- a/source/d/llvm/llvm.SlackBuild +++ b/source/d/llvm/llvm.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for llvm # Copyright 2008-2016 Heinz Wiesinger, Amsterdam, The Netherlands -# Copyright 2012, 2013, 2014, 2015, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2012, 2013, 2014, 2015, 2016, 2018, 2019 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -69,6 +69,13 @@ PY2=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_pytho # Python3 short version: PY3=$(python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())' | cut -f 2 -d n | cut -f 1 -d /) +# Sadly, glibc-2.30 exposed some sort of problem with clang and icecream. +# The symptom is a compile failure that says none of the types in +# <linux/types.h> are defined, even though they are. gcc/g++ seem unaffected. +# For now, not much choice other than to disable this. +# Don't use icecream: +PATH=$(echo $PATH | sed "s|/usr/libexec/icecc/bin||g" | tr -s : | sed "s/^://g" | sed "s/:$//g") + rm -rf $PKG mkdir -p $TMP $PKG cd $TMP @@ -114,26 +121,21 @@ zcat $CWD/clang.toolchains.i586.triple.diff.gz | patch -p1 --verbose || exit 1 # clangd to avoid the failure. Any help with a proper fix is appreciated. # I have not reported this upstream since I suspect that it's an artifact # of our convoluted build method. -if [ $ARCH = i586 ] || [ $ARCH = i686 ]; then - zcat $CWD/clang-tools-extra.no.clangd.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 -fi +case $ARCH in + i?86) CLANGD="-DCLANG_ENABLE_CLANGD=OFF" ;; + *) unset CLANGD ;; +esac chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ + -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; + -exec chmod 644 {} \+ -# Work around https://llvm.org/bugs/show_bug.cgi?id=30587 -# by building clang with shared libs -zcat $CWD/n_clang_allow_BUILD_SHARED_LIBRARY.patch.gz | patch -p0 --verbose || exit 1 - -# need to disable assertions to make llvm thread-safe -# clang resource dir is a relative path based on the location of the clang binary mkdir build cd build - cmake \ + cmake -GNinja \ -DCMAKE_C_COMPILER="clang" \ -DCMAKE_CXX_COMPILER="clang++" \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ @@ -141,52 +143,20 @@ cd build -DCMAKE_INSTALL_PREFIX=/usr \ -DLLVM_LIBDIR_SUFFIX=${LIBDIRSUFFIX} \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ - -DCLANG_BUILD_SHARED_LIBS=ON \ - -DLLVM_BUILD_LLVM_DYLIB=ON \ - -DLLVM_LINK_LLVM_DYLIB=ON \ + -DBUILD_SHARED_LIBS=ON \ -DLLVM_USE_LINKER=gold \ -DLLVM_ENABLE_RTTI=ON \ -DLLVM_ENABLE_FFI=ON \ -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_USE_OPROFILE=ON \ -DLLVM_INSTALL_UTILS=ON \ -DLLVM_BINUTILS_INCDIR=/usr/include \ -DCLANG_RESOURCE_DIR="../lib${LIBDIRSUFFIX}/clang/${VERSION}" \ - .. || exit 1 - - # Breaks with one of the patches above. Maybe revisit later? - # -DBUILD_SHARED_LIBS=ON \ - - # This seems to not like a parallel build, at least as of 7.0.0. I don't have - # days to wait for the compile though, so let's just smack it with a hammer - # fifty times before dropping back to a single-threaded build: - for index in $(seq 1 50) ; do - #make $NUMJOBS VERBOSE=1 - make $NUMJOBS - ERR_RESULT=$? - if [ $ERR_RESULT = 0 ]; then - break - fi - echo "*** PARALLEL MAKE RESTART NUMBER $index" - done - if [ ! $ERR_RESULT = 0 ]; then - # Fifty more for the single thread: - for index in $(seq 1 50) ; do - #make VERBOSE=1 - make - ERR_RESULT=$? - if [ $ERR_RESULT = 0 ]; then - break - fi - echo "*** NON-PARALLEL MAKE RESTART NUMBER $index" - done - fi - if [ ! $ERR_RESULT = 0 ]; then - exit 1 - fi - - make install DESTDIR=$PKG || exit 1 + -DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \ + $CLANGD \ + .. || exit 1 + + "${NINJA:=ninja}" $NUMJOBS || exit 1 + DESTDIR=$PKG "$NINJA" install || exit 1 cd .. # Add symlinks for $ARCH-slackware-linux-{clang,clang++}: @@ -237,7 +207,7 @@ mv $PKG/usr/share/man $PKG/usr/ ) # Compress manual pages: -find $PKG/usr/man -type f -exec gzip -9 {} \; +find $PKG/usr/man -type f -exec gzip -9 {} \+ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz rm $i |