summaryrefslogtreecommitdiff
path: root/source/d/llvm/llvm.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/llvm/llvm.SlackBuild')
-rwxr-xr-xsource/d/llvm/llvm.SlackBuild22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/d/llvm/llvm.SlackBuild b/source/d/llvm/llvm.SlackBuild
index 87428b38..591ed74d 100755
--- a/source/d/llvm/llvm.SlackBuild
+++ b/source/d/llvm/llvm.SlackBuild
@@ -27,7 +27,7 @@ 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:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -114,9 +114,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# disable value profiling until https://llvm.org/bugs/show_bug.cgi?id=30587
-# is fixed.
-zcat $CWD/clang_disable_pgo.patch.gz | patch -p1 --verbose || exit 1
+# 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
@@ -130,12 +130,14 @@ 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_DYLIB_EXPORT_ALL=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_ASSERTIONS=OFF \
+ -DLLVM_USE_OPROFILE=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DCLANG_RESOURCE_DIR="../lib${LIBDIRSUFFIX}/clang/${VERSION}" \
.. || exit 1
@@ -163,8 +165,10 @@ done
rm -f $PKG/usr/lib$LIBDIRSUFFIX/libgomp.so
# Install Python bindings
-mkdir -p "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages"
-cp -a tools/clang/bindings/python/clang "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/"
+for pyver in 2.7 3.6; do
+ mkdir -p "$PKG/usr/lib$LIBDIRSUFFIX/python$pyver/site-packages"
+ cp -a tools/clang/bindings/python/clang "$PKG/usr/lib$LIBDIRSUFFIX/python$pyver/site-packages/"
+done
# Remove bundled python-six
rm -f "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/six.py"
@@ -172,12 +176,16 @@ rm -f "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/six.py"
# Compile Python scripts
python -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/clang"
python -O -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/clang"
+python3 -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python3.6/site-packages/clang"
+python3 -O -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python3.6/site-packages/clang"
python -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/lldb"
python -O -m compileall "$PKG/usr/lib$LIBDIRSUFFIX/python2.7/site-packages/lldb"
python -m compileall "$PKG/usr/share/scan-view"
python -O -m compileall "$PKG/usr/share/scan-view"
python -m compileall "$PKG/usr/share/clang"
python -O -m compileall "$PKG/usr/share/clang"
+python -m compileall "$PKG/usr/share/opt-viewer"
+python -O -m compileall "$PKG/usr/share/opt-viewer"
# Move man page directory:
mv $PKG/usr/share/man $PKG/usr/