summaryrefslogtreecommitdiffstats
path: root/source/d/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/llvm')
-rwxr-xr-xsource/d/llvm/llvm.SlackBuild107
-rw-r--r--source/d/llvm/llvm.polly.hack.diff12
-rw-r--r--source/d/llvm/llvm.sanitizer_platform_limits_posix.cpp.glibc-2.36.diff27
-rw-r--r--source/d/llvm/llvm.url52
4 files changed, 83 insertions, 115 deletions
diff --git a/source/d/llvm/llvm.SlackBuild b/source/d/llvm/llvm.SlackBuild
index 5996a1001..af3baf881 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, 2019, 2020, 2021, 2022 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021, 2022, 2023 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -27,23 +27,19 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=llvm
VERSION=${VERSION:-$(echo llvm-*.tar.xz | rev | cut -f 4- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-1}
# For the two options below, either set both to OFF or *only one* to ON:
-# Build using -DBUILD_SHARED_LIBS=ON.
-# While this is not the officially recommended way to build LLVM, it produces
-# a smaller package and the compiler seems to be reliable when built this way.
-BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:=ON}
-
# Build using -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON:
-# This is the recommended way to built LLVM with shared libraries, however
-# the resulting package is twice as large and also wasn't able to build
-# Firefox or Thunderbird here. If you rebuild LLVM with this option, you'll
-# also need to recompile spirv-llvm-translator, mesa, and possibly other
-# third party packages. The resulting compiler has not been reliable here.
-# I would not recommend using this option, but feel free to try it.
-LLVM_BUILD_LLVM_DYLIB=${LLVM_BUILD_LLVM_DYLIB:=OFF}
+# This is the upstream recommended way to build LLVM with shared libraries and
+# seems to be the way to go these days.
+LLVM_BUILD_LLVM_DYLIB=${LLVM_BUILD_LLVM_DYLIB:=ON}
+
+# Build using -DBUILD_SHARED_LIBS=ON.
+# We used this for years here to get a smaller LLVM package, but it no longer
+# works. Feel free to try it, but expect breakage.
+BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:=OFF}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
@@ -55,19 +51,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# Building clangd will be determined automatically unless BUILD_CLANG is
-# preset to YES or NO:
-if [ -z $BUILD_CLANGD ]; then
- if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
- BUILD_CLANGD=NO
- else
- BUILD_CLANGD=YES
- fi
-fi
-if [ "$BUILD_CLANGD" = "NO" ]; then
- CLANGD="-DCLANG_ENABLE_CLANGD=OFF"
-fi
-
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
@@ -80,20 +63,37 @@ TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
BUILDDIR=${TMP}/llvm-build-${VERSION}
+# Ignore that which should be ignored to avoid long build times and
+# massive warning spew:
+IGNORE_GNU_EXTENSIONS=${IGNORE_GNU_EXTENSIONS:--Wno-unknown-warning-option -Wno-gnu-line-marker -Wno-gnu-anonymous-struct}
+
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686 $IGNORE_GNU_EXTENSIONS"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686 $IGNORE_GNU_EXTENSIONS"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
+ SLKCFLAGS="-O2 -fPIC $IGNORE_GNU_EXTENSIONS"
LIBDIRSUFFIX="64"
else
- SLKCFLAGS="-O2"
+ SLKCFLAGS="-O2 $IGNORE_GNU_EXTENSIONS"
LIBDIRSUFFIX=""
fi
+# Building clangd will be determined automatically unless BUILD_CLANG is
+# preset to YES or NO:
+if [ -z $BUILD_CLANGD ]; then
+ if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
+ BUILD_CLANGD=NO
+ else
+ BUILD_CLANGD=YES
+ fi
+fi
+if [ "$BUILD_CLANGD" = "NO" ]; then
+ CLANGD="-DCLANG_ENABLE_CLANGD=OFF"
+fi
+
# Python2 short version:
PY2=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())' | cut -f 2 -d n | cut -f 1 -d /)
# Python3 short version:
@@ -116,6 +116,12 @@ cd $BUILDDIR
touch configure
chmod 755 configure
+# Extract and rename some support files:
+tar xvf $CWD/cmake-$VERSION.src.tar.xz || exit 1
+mv cmake-$VERSION.src cmake
+tar xvf $CWD/third-party-$VERSION.src.tar.xz || exit 1
+mv third-party-$VERSION.src third-party
+
rm -rf $PKGNAM-${VERSION}.src $PKGNAM-${VERSION}
tar xvf $CWD/$PKGNAM-$VERSION.src.tar.xz || exit 1
@@ -134,9 +140,9 @@ cd tools/clang/tools || exit 1
tar xvf $CWD/clang-tools-extra-$VERSION.src.tar.xz || exit 1
mv clang-tools-extra-${VERSION} extra 2>/dev/null \
|| mv clang-tools-extra-${VERSION}.src extra || exit 1
- # HACK # Otherwise the build fails because files aren't found.
- rm -rf $TMP/clang-tools-extra
- cp -a extra $TMP/clang-tools-extra
+ ## HACK # Otherwise the build fails because files aren't found.
+ #rm -rf $TMP/clang-tools-extra
+ #cp -a extra $TMP/clang-tools-extra
cd ../../../
cd projects || exit 1
@@ -158,26 +164,16 @@ cd ../
# Support GCC built for i586-slackware-linux:
zcat $CWD/clang.toolchains.i586.triple.diff.gz | patch -p1 --verbose || exit 1
-# Hack to fix build with polly. Maybe we should just not use polly... ?
-zcat $CWD/llvm.polly.hack.diff.gz | patch -p1 --verbose || exit 1
-
# We require libatomic on 32-bit platforms:
-if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
- zcat $CWD/lldb.32-bit.link.libatomic.diff.gz | patch -p1 --verbose || exit 1
+if [ -f ./tools/lldb/source/Utility/CMakeLists.txt ]; then
+ if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then
+ zcat $CWD/lldb.32-bit.link.libatomic.diff.gz | patch -p1 --verbose || exit 1
+ fi
fi
-# Won't build without this. See https://github.com/llvm/llvm-project/issues/54941
-#zcat $CWD/llvm.bypass.broken.benchmarks.diff.gz | patch -p1 --verbose || exit 1
-
-# Patch to fix build with glibc-2.36:
-zcat $CWD/llvm.sanitizer_platform_limits_posix.cpp.glibc-2.36.diff.gz | patch -p1 --verbose || exit 1
-
-# These hackish links seem to be required...
+# This hackish link seems to be required...
cd ..
-ln -sf */utils/gn/secondary/third-party .
ln -sf */runtimes .
-ln -sf */projects/libcxx .
-ln -sf */projects/libcxxabi .
cd -
chown -R root:root .
@@ -210,19 +206,25 @@ cd build
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_LIBDIR_SUFFIX=${LIBDIRSUFFIX} \
+ -DLIBCXX_LIBDIR_SUFFIX=${LIBDIRSUFFIX} \
+ -DLIBCXXABI_LIBDIR_SUFFIX=${LIBDIRSUFFIX} \
-DCMAKE_BUILD_TYPE=Release \
$SHARED_LIBRARY_OPTIONS \
- -DLLVM_USE_LINKER=gold \
+ -DLLVM_USE_LINKER=lld \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_FFI=ON \
+ -DLLVM_ENABLE_ZLIB=ON \
-DLLVM_ENABLE_ASSERTIONS=OFF \
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
- -DCLANG_RESOURCE_DIR="../lib${LIBDIRSUFFIX}/clang/${VERSION}" \
+ -DCLANG_RESOURCE_DIR="../lib${LIBDIRSUFFIX}/clang/$(echo $VERSION | cut -f 1 -d .)" \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \
- -DLLDB_USE_SYSTEM_SIX=1 \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
+ -DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
+ -DCLANG_DEFAULT_PIE_ON_LINUX=ON \
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
$CLANGD \
.. || exit 1
@@ -248,6 +250,7 @@ if [ ! -r $PKG/usr/bin/lit-cpuid ]; then
chown root:root $PKG/usr/bin/lit-cpuid
chmod 755 $PKG/usr/bin/lit-cpuid
fi
+
# Remove symlink to libgomp, which is already provided by gcc:
rm -f $PKG/usr/lib$LIBDIRSUFFIX/libgomp.so
diff --git a/source/d/llvm/llvm.polly.hack.diff b/source/d/llvm/llvm.polly.hack.diff
deleted file mode 100644
index eb607ca2b..000000000
--- a/source/d/llvm/llvm.polly.hack.diff
+++ /dev/null
@@ -1,12 +0,0 @@
---- ./projects/polly/lib/CMakeLists.txt.orig 2020-03-23 10:01:02.000000000 -0500
-+++ ./projects/polly/lib/CMakeLists.txt 2020-03-24 14:47:14.602756953 -0500
-@@ -139,7 +139,8 @@
- )
-
- # Polly-ACC requires the NVPTX target to be present in the executable it is linked to
-- set_property(TARGET bugpoint APPEND PROPERTY LINK_LIBRARIES LLVMTarget)
-+ # Randomly commented to fix build lol
-+ #set_property(TARGET bugpoint APPEND PROPERTY LINK_LIBRARIES LLVMTarget)
- endif ()
-
- # Create a loadable module Polly.so that can be loaded using
diff --git a/source/d/llvm/llvm.sanitizer_platform_limits_posix.cpp.glibc-2.36.diff b/source/d/llvm/llvm.sanitizer_platform_limits_posix.cpp.glibc-2.36.diff
deleted file mode 100644
index 901741a06..000000000
--- a/source/d/llvm/llvm.sanitizer_platform_limits_posix.cpp.glibc-2.36.diff
+++ /dev/null
@@ -1,27 +0,0 @@
---- ./projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp.orig 2022-06-22 11:46:24.000000000 -0500
-+++ ./projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp 2022-08-05 22:46:21.288664504 -0500
-@@ -73,7 +73,9 @@
- #include <sys/vt.h>
- #include <linux/cdrom.h>
- #include <linux/fd.h>
-+#if SANITIZER_ANDROID
- #include <linux/fs.h>
-+#endif
- #include <linux/hdreg.h>
- #include <linux/input.h>
- #include <linux/ioctl.h>
-@@ -857,10 +859,10 @@
- unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
- unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
- #endif
-- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
-- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
-- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
-- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
-+ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
-+ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
-+ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
-+ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
- unsigned IOCTL_GIO_CMAP = GIO_CMAP;
- unsigned IOCTL_GIO_FONT = GIO_FONT;
- unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/source/d/llvm/llvm.url b/source/d/llvm/llvm.url
index 6defe5750..bad892337 100644
--- a/source/d/llvm/llvm.url
+++ b/source/d/llvm/llvm.url
@@ -1,25 +1,29 @@
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang-tools-extra-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/compiler-rt-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/flang-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/lldb-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/openmp-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/polly-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/libcxx-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/libcxxabi-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/lld-14.0.6.src.tar.xz
-https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/libunwind-14.0.6.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang-tools-extra-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/compiler-rt-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/flang-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/lldb-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/openmp-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/polly-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/libcxx-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/libcxxabi-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/lld-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/libunwind-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/cmake-16.0.0.src.tar.xz
+https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/third-party-16.0.0.src.tar.xz
-#http://llvm.org/releases/14.0.6/llvm-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/clang-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/clang-tools-extra-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/compiler-rt-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/flang-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/lldb-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/openmp-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/polly-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/libcxx-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/libcxxabi-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/lld-14.0.6.src.tar.xz
-#http://llvm.org/releases/14.0.6/libunwind-14.0.6.src.tar.xz
+#http://llvm.org/releases/16.0.0/llvm-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/clang-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/clang-tools-extra-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/compiler-rt-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/flang-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/lldb-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/openmp-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/polly-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/libcxx-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/libcxxabi-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/lld-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/libunwind-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/cmake-16.0.0.src.tar.xz
+#http://llvm.org/releases/16.0.0/third-party-16.0.0.src.tar.xz