Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (f493c1de298cab2a5b129b0c9676874faa3ef551)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (f493c1de298cab2a5b129b0c9676874faa3ef551)
  • Date: Sat, 4 Jan 2025 11:38:06 +0000

GIT changes to master grimoire by Justin Boffemmyer <flux AT sourcemage.org>:

devel/llvm/BUILD | 82 ++++++++++++++++++++++++++----
devel/llvm/CONFIGURE | 44 +++++++++-------
devel/llvm/DEPENDS | 10 +--
devel/llvm/DETAILS | 120
++++++++++++++++++++++++++++++---------------
devel/llvm/FINAL | 27 ----------
devel/llvm/HISTORY | 10 +++
devel/llvm/INSTALL | 19 +++----
devel/llvm/PREPARE | 49 ++++++++++++++++--
devel/llvm/PRE_BUILD | 104 +++++++++++++++++++++++++--------------
devel/llvm/PRE_SUB_DEPENDS | 27 +++++-----
devel/llvm/SUB_DEPENDS | 4 -
11 files changed, 327 insertions(+), 169 deletions(-)

New commits:
commit f493c1de298cab2a5b129b0c9676874faa3ef551
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

devel/llvm: fix sub-project builds

Restructure the build to match how upstream recommends building. Add
support for BOLT and MLIR. Correct the builds with runtimes
(compiler-rt, etc.) so that they are fully enabled as runtimes
(compiler-rt now correctly builds and provides ASAN, etc.).

Also corrected whitespace, variable usage, etc. for both consistency and
to align with current grimoire policy.

diff --git a/devel/llvm/BUILD b/devel/llvm/BUILD
index 6a678f3..8a78a0b 100755
--- a/devel/llvm/BUILD
+++ b/devel/llvm/BUILD
@@ -1,29 +1,89 @@
case "$HOST" in
(*-musl)
- OPTS+=' -DLIBCXX_HAS_MUSL_LIBC=YES'
+ OPTS="$OPTS -DLIBCXX_HAS_MUSL_LIBC=YES"
;;
esac &&
+
# Remove -DPIC from compiler flags, produces build errors
CXXFLAGS="${CXXFLAGS//-DPIC}" &&
+
# Default target, not detected correctly
-OPTS+=" -DLLVM_DEFAULT_TARGET_TRIPLE=$HOST" &&
+OPTS="$OPTS -DLLVM_DEFAULT_TARGET_TRIPLE=$HOST" &&
+
# LLVM_TARGETS
-OPTS+=" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS// /;}" &&
+OPTS="$OPTS -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS// /;}" &&
+
# recommended by mesa project
-OPTS+=" -DLLVM_LINK_LLVM_DYLIB=1 -DCMAKE_BUILD_TYPE=RELEASE" &&
+OPTS="$OPTS -DLLVM_LINK_LLVM_DYLIB=1" &&
+
+OPTS="$OPTS -DLLVM_BUILD_BENCHMARKS=OFF" &&
+OPTS="$OPTS -DLLVM_INCLUDE_BENCHMARKS=OFF" &&
+OPTS="$OPTS -DLLVM_INCLUDE_TESTS=OFF" &&
+
# prevent unnecessary use of libedit and ncurses
if ! is_depends_enabled $SPELL libedit;then
- OPTS+=" -DLLVM_ENABLE_LIBEDIT=0" &&
- OPTS+=" -DLLVM_ENABLE_TERMINFO=0" &&
- OPTS+=" -DLLVM_ENABLE_BACKTRACES=0"
+ OPTS="$OPTS -DLLVM_ENABLE_LIBEDIT=OFF" &&
+ OPTS="$OPTS -DLLVM_ENABLE_TERMINFO=OFF" &&
+ OPTS="$OPTS -DLLVM_ENABLE_BACKTRACES=OFF"
fi &&
+
# Enable RTTI if requested, recommended, changing it breaks the ABI
if [[ y == "$LLVM_WITH_RTTI" ]]; then
- OPTS+=" -DLLVM_ENABLE_RTTI=ON"
+ OPTS="$OPTS -DLLVM_ENABLE_RTTI=ON"
else
- OPTS+=" -DLLVM_ENABLE_RTTI=OFF"
+ OPTS="$OPTS -DLLVM_ENABLE_RTTI=OFF"
+fi &&
+
+OPTS="$OPTS -DLLVM_TOOL_LIBCLC_BUILD=ON"
+
+if [[ "$LLVM_WITH_BOLT" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_BOLT_BUILD=ON"
+fi &&
+
+if [[ "$LLVM_WITH_CLANG" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=ON"
+fi &&
+
+if [[ "$LLVM_WITH_LLD" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_LLD_BUILD=ON"
+fi &&
+
+if [[ "$LLVM_WITH_LLDB" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_LLDB_BUILD=ON"
+fi &&
+
+if [[ "$LLVM_WITH_MLIR" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_MLIR_BUILD=ON"
+fi &&
+
+if [[ "$LLVM_WITH_POLLY" == y ]] ;then
+ OPTS="$OPTS -DLLVM_TOOL_POLLY_BUILD=ON"
+fi &&
+
+# enable requested runtimes
+OPTS="$OPTS -DLLVM_ENABLE_RUNTIMES=${LLVM_RUNTIMES// /;}" &&
+
+if list_find "$LLVM_RUNTIMES" "compiler-rt" ;then
+ OPTS="$OPTS -DLLVM_TOOL_COMPILER_RT_BUILD=ON"
fi &&

-OPTS+=" -DLLVM_BUILD_BENCHMARKS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF
-DLLVM_INCLUDE_TESTS=OFF" &&
+if list_find "$LLVM_RUNTIMES" "libcxx" ;then
+ OPTS="$OPTS -DLLVM_TOOL_LIBCXX_BUILD=ON" &&
+ # libcxx includes benchmarks by default, which in turn depend ON
+ # google-benchmark, so disable them
+ OPTS="$OPTS -DLIBCXX_INCLUDE_BENCHMARKS=OFF"
+fi &&
+
+if list_find "$LLVM_RUNTIMES" "libcxxabi" ;then
+ OPTS="$OPTS -DLLVM_TOOL_LIBCXXABI_BUILD=ON"
+fi &&
+
+if list_find "$LLVM_RUNTIMES" "libunwind" ;then
+ OPTS="$OPTS -DLLVM_TOOL_LIBUNWIND_BUILD=ON"
+fi &&
+
+if list_find "$LLVM_RUNTIMES" "openmp" ;then
+ OPTS="$OPTS -DLLVM_TOOL_OPENMP_BUILD=ON"
+fi &&

-cmake_build
+cmake_build -S ../llvm
diff --git a/devel/llvm/CONFIGURE b/devel/llvm/CONFIGURE
index b364b0d..ce2411b 100755
--- a/devel/llvm/CONFIGURE
+++ b/devel/llvm/CONFIGURE
@@ -1,31 +1,35 @@
. $GRIMOIRE/config_query_multi.function &&
+. $GRIMOIRE/CMAKE_CONFIGURE &&
+
message "$DEFAULT_COLOR$MESSAGE_COLOR" \
"LLVM can build multiple backends." \
"\nFor most people, X86 and AMDGPU are sufficient." &&
+
config_query_multi LLVM_TARGETS "which backend targets?" \
- AArch64 \
- AMDGPU \
- ARM \
- AVR \
- BPF \
- Hexagon \
- Lanai \
- Mips \
- MSP430 \
- NVPTX \
- PowerPC \
- RISCV \
- Sparc \
- SystemZ \
- VE \
- WebAssembly \
- X86 \
- XCore &&
+ all \
+ AArch64 \
+ AMDGPU \
+ ARM \
+ AVR \
+ BPF \
+ Hexagon \
+ Lanai \
+ Mips \
+ MSP430 \
+ NVPTX \
+ PowerPC \
+ RISCV \
+ Sparc \
+ SystemZ \
+ VE \
+ WebAssembly \
+ X86 \
+ XCore \
+ &&

if [[ "$LLVM_WITH_CLANG" == "y" ]]
then
config_query LLVM_WITH_ANALYZER \
"Install clang static analyzer (scan-build and scan-view)?" \
n
-fi &&
-. $GRIMOIRE/CMAKE_CONFIGURE
+fi
diff --git a/devel/llvm/DEPENDS b/devel/llvm/DEPENDS
index 494772e..edbd1f4 100755
--- a/devel/llvm/DEPENDS
+++ b/devel/llvm/DEPENDS
@@ -8,13 +8,13 @@ esac &&
depends libtool &&
depends -sub CXX gcc &&
depends PKG-CONFIG &&
-depends zlib '-DLLVM_ENABLE_ZLIB=1' &&
+depends zlib '-DLLVM_ENABLE_ZLIB=ON' &&
depends python3 &&
depends mako &&
-if [[ "$LLVM_WITH_ANALYZER" == "y" ]]
-then
+if [[ "$LLVM_WITH_ANALYZER" == "y" ]] ;then
optional_depends z3 \
- -DCLANG_ANALYZER_ENABLE_Z3_SOLVER={1,0} \
+ -DCLANG_ANALYZER_ENABLE_Z3_SOLVER=ON \
+ -DCLANG_ANALYZER_ENABLE_Z3_SOLVER=OFF \
'for Z3 solver support in Clang Static Analyzer' &&
# perl is required for scan-build, which is the analyzer itself
runtime_depends perl
@@ -22,7 +22,7 @@ fi &&

optional_depends ocaml '' '' 'build bindings for OCaml' &&
optional_depends doxygen '' '' "build documentation?" &&
-optional_depends libffi '-DLLVM_ENABLE_FFI=1' '' 'use sytem FFI' &&
+optional_depends libffi '-DLLVM_ENABLE_FFI=ON' '' 'use sytem FFI' &&
if [[ "$LLVM_WITH_LLDB" == y ]]; then
depends six -DLLDB_USE_SYSTEM_SIX=YES &&
depends swig &&
diff --git a/devel/llvm/DETAILS b/devel/llvm/DETAILS
index 3d3628b..9c9f068 100755
--- a/devel/llvm/DETAILS
+++ b/devel/llvm/DETAILS
@@ -1,82 +1,122 @@
# Watch: https://github.com/llvm/llvm-project/releases
/llvmorg-([0-9.]+)[.]tar
SPELL=llvm
VERSION=19.1.6
+
GITHUB_URI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$VERSION";
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/llvm-project"
SOURCE="${SPELL}-${VERSION}.src.tar.xz"
SOURCE2=$SOURCE.sig
-
GITHUB_URI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$VERSION";
SOURCE_URL[0]="${GITHUB_URI}/${SOURCE}"
SOURCE2_URL[0]="${SOURCE_URL[0]}.sig"
SOURCE_GPG=llvm.gpg:$SOURCE2:UPSTREAM_KEY
SOURCE2_IGNORE=signature
-if [[ "$LLVM_WITH_CLANG" == y ]]; then
- SOURCE3="clang-${VERSION}.src.tar.xz"
- SOURCE3_URL[0]="${GITHUB_URI}/${SOURCE3}"
+ SOURCE3="cmake-${VERSION}.src.tar.xz"
+ SOURCE3_URL[0]="${GITHUB_URI}/${SOURCE25}"
SOURCE4="$SOURCE3.sig"
SOURCE4_URL[0]="${SOURCE3_URL[0]}.sig"
SOURCE3_GPG="llvm.gpg:$SOURCE4:UPSTREAM_KEY"
- SOURCE4_IGNORE="signature"
- SOURCE5="compiler-rt-${VERSION}.src.tar.xz"
+ SOURCE4_IGNORE=signature
+if [[ "$LLVM_WITH_BOLT" == y ]]; then
+ SOURCE5="bolt-${VERSION}.src.tar.xz"
SOURCE5_URL[0]="${GITHUB_URI}/${SOURCE5}"
SOURCE6="$SOURCE5.sig"
- SOURCE5_GPG="llvm.gpg:$SOURCE6:UPSTREAM_KEY"
SOURCE6_URL[0]="${SOURCE5_URL[0]}.sig"
+ SOURCE5_GPG="llvm.gpg:$SOURCE6:UPSTREAM_KEY"
SOURCE6_IGNORE="signature"
- SOURCE9="clang-tools-extra-${VERSION}.src.tar.xz"
- SOURCE9_URL[0]="${GITHUB_URI}/${SOURCE9}"
- SOURCE10="$SOURCE9.sig"
- SOURCE10_URL[0]="${SOURCE9_URL[0]}.sig"
- SOURCE10_IGNORE=signature
- SOURCE9_GPG="llvm.gpg:$SOURCE10:UPSTREAM_KEY"
fi
-if [[ "$LLVM_WITH_LLDB" == y ]]; then
- SOURCE7="lldb-${VERSION}.src.tar.xz"
+if [[ "$LLVM_WITH_CLANG" == y ]]; then
+ SOURCE7="clang-${VERSION}.src.tar.xz"
SOURCE7_URL[0]="${GITHUB_URI}/${SOURCE7}"
SOURCE8="$SOURCE7.sig"
SOURCE8_URL[0]="${SOURCE7_URL[0]}.sig"
SOURCE7_GPG="llvm.gpg:$SOURCE8:UPSTREAM_KEY"
SOURCE8_IGNORE="signature"
+ SOURCE9="clang-tools-extra-${VERSION}.src.tar.xz"
+ SOURCE9_URL[0]="${GITHUB_URI}/${SOURCE9}"
+ SOURCE10="$SOURCE9.sig"
+ SOURCE10_URL[0]="${SOURCE9_URL[0]}.sig"
+ SOURCE9_GPG="llvm.gpg:$SOURCE10:UPSTREAM_KEY"
+ SOURCE10_IGNORE=signature
fi
-if [[ "$LLVM_WITH_POLLY" == y ]]; then
- SOURCE11="polly-${VERSION}.src.tar.xz"
- SOURCE11_URL[0]="${GITHUB_URI}/${SOURCE11}"
+if [[ "$LLVM_WITH_LLD" == y ]]; then
+ SOURCE11="lld-${VERSION}.src.tar.xz"
+ SOURCE11_URL[0]="${GITHUB_URI}/${SOURCE11}"
SOURCE12="$SOURCE11.sig"
SOURCE12_URL[0]="${SOURCE11_URL[0]}.sig"
- SOURCE11_GPG="llvm.gpg:$SOURCE12:UPSTREAM_KEY"
+ SOURCE11_GPG="llvm.gpg:$SOURCE12:UPSTREAM_KEY"
SOURCE12_IGNORE="signature"
fi
-if [[ "$LLVM_WITH_LLD" == y ]]; then
- SOURCE13="lld-${VERSION}.src.tar.xz"
- SOURCE13_URL[0]="${GITHUB_URI}/${SOURCE13}"
+if [[ "$LLVM_WITH_LLDB" == y ]]; then
+ SOURCE13="lldb-${VERSION}.src.tar.xz"
+ SOURCE13_URL[0]="${GITHUB_URI}/${SOURCE13}"
SOURCE14="$SOURCE13.sig"
SOURCE14_URL[0]="${SOURCE13_URL[0]}.sig"
- SOURCE13_GPG="llvm.gpg:$SOURCE14:UPSTREAM_KEY"
+ SOURCE13_GPG="llvm.gpg:$SOURCE14:UPSTREAM_KEY"
SOURCE14_IGNORE="signature"
- SOURCE15="libunwind-${VERSION}.src.tar.xz"
- SOURCE15_URL[0]="${GITHUB_URI}/${SOURCE15}"
+fi
+if [[ "$LLVM_WITH_MLIR" == y ]]; then
+ SOURCE15="mlir-${VERSION}.src.tar.xz"
+ SOURCE15_URL[0]="${GITHUB_URI}/${SOURCE15}"
SOURCE16="$SOURCE15.sig"
SOURCE16_URL[0]="${SOURCE15_URL[0]}.sig"
- SOURCE15_GPG="llvm.gpg:$SOURCE16:UPSTREAM_KEY"
+ SOURCE15_GPG="llvm.gpg:$SOURCE16:UPSTREAM_KEY"
SOURCE16_IGNORE="signature"
- SOURCE17="libcxx-${VERSION}.src.tar.xz"
- SOURCE17_URL[0]="${GITHUB_URI}/${SOURCE17}"
+fi
+if [[ "$LLVM_WITH_POLLY" == y ]]; then
+ SOURCE17="polly-${VERSION}.src.tar.xz"
+ SOURCE17_URL[0]="${GITHUB_URI}/${SOURCE17}"
SOURCE18="$SOURCE17.sig"
SOURCE18_URL[0]="${SOURCE17_URL[0]}.sig"
- SOURCE17_GPG="llvm.gpg:$SOURCE18:UPSTREAM_KEY"
+ SOURCE17_GPG="llvm.gpg:$SOURCE18:UPSTREAM_KEY"
SOURCE18_IGNORE="signature"
- SOURCE19="libcxxabi-${VERSION}.src.tar.xz"
+fi
+if [[ -n "$LLVM_RUNTIMES" ]] ;then
+ SOURCE19="runtimes-${VERSION}.src.tar.xz"
SOURCE19_URL[0]="${GITHUB_URI}/${SOURCE19}"
- SOURCE20="$SOURCE19.sig"
- SOURCE20_URL[0]="${SOURCE19_URL[0]}.sig"
+ SOURCE20="$SOURCE19.sig"
+ SOURCE20_URL[0]="${SOURCE19_URL[0]}.sig"
SOURCE19_GPG="llvm.gpg:$SOURCE20:UPSTREAM_KEY"
- SOURCE20_IGNORE="signature"
+ SOURCE20_IGNORE="signature"
+fi
+if list_find "$LLVM_RUNTIMES" "compiler-rt" ;then
+ SOURCE21="compiler-rt-${VERSION}.src.tar.xz"
+ SOURCE21_URL[0]="${GITHUB_URI}/${SOURCE21}"
+ SOURCE22="$SOURCE21.sig"
+ SOURCE22_URL[0]="${SOURCE21_URL[0]}.sig"
+ SOURCE21_GPG="llvm.gpg:$SOURCE22:UPSTREAM_KEY"
+ SOURCE22_IGNORE="signature"
+fi
+if list_find "$LLVM_RUNTIMES" "libcxx" ;then
+ SOURCE23="libcxx-${VERSION}.src.tar.xz"
+ SOURCE23_URL[0]="${GITHUB_URI}/${SOURCE23}"
+ SOURCE24="$SOURCE23.sig"
+ SOURCE24_URL[0]="${SOURCE23_URL[0]}.sig"
+ SOURCE23_GPG="llvm.gpg:$SOURCE24:UPSTREAM_KEY"
+ SOURCE24_IGNORE="signature"
+fi
+if list_find "$LLVM_RUNTIMES" "libcxxabi" ;then
+ SOURCE25="libcxxabi-${VERSION}.src.tar.xz"
+ SOURCE25_URL[0]="${GITHUB_URI}/${SOURCE25}"
+ SOURCE26="$SOURCE25.sig"
+ SOURCE26_URL[0]="${SOURCE25_URL[0]}.sig"
+ SOURCE25_GPG="llvm.gpg:$SOURCE26:UPSTREAM_KEY"
+ SOURCE26_IGNORE="signature"
+fi
+if list_find "$LLVM_RUNTIMES" "libunwind" ;then
+ SOURCE27="libunwind-${VERSION}.src.tar.xz"
+ SOURCE27_URL[0]="${GITHUB_URI}/${SOURCE27}"
+ SOURCE28="$SOURCE27.sig"
+ SOURCE28_URL[0]="${SOURCE27_URL[0]}.sig"
+ SOURCE27_GPG="llvm.gpg:$SOURCE28:UPSTREAM_KEY"
+ SOURCE28_IGNORE="signature"
+fi
+if list_find "$LLVM_RUNTIMES" "openmp" ;then
+ SOURCE29="openmp-${VERSION}.src.tar.xz"
+ SOURCE29_URL[0]="${GITHUB_URI}/${SOURCE29}"
+ SOURCE30="$SOURCE29.sig"
+ SOURCE30_URL[0]="${SOURCE29_URL[0]}.sig"
+ SOURCE29_GPG="llvm.gpg:$SOURCE30:UPSTREAM_KEY"
+ SOURCE30_IGNORE="signature"
fi
- SOURCE21="cmake-${VERSION}.src.tar.xz"
- SOURCE21_URL[0]="${GITHUB_URI}/${SOURCE21}"
- SOURCE22="$SOURCE21.sig"
- SOURCE22_URL[0]="${SOURCE21_URL[0]}.sig"
- SOURCE22_IGNORE=signature
- SOURCE21_GPG="llvm.gpg:$SOURCE22:UPSTREAM_KEY"
-SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SOURCE%.tar.xz}"
WEB_SITE="https://llvm.org";
LICENSE[0]=BSD
ENTERED=20081115
diff --git a/devel/llvm/FINAL b/devel/llvm/FINAL
deleted file mode 100755
index e39b2f2..0000000
--- a/devel/llvm/FINAL
+++ /dev/null
@@ -1,27 +0,0 @@
-if [[ "$LLVM_WITH_ANALYZER" == "y" ]]; then
- target="${INSTALL_ROOT}/usr/share/llvm" &&
-
- chown "root:root" "${target}/scan-build" &&
- chmod 0755 "${target}/scan-build" &&
-
- chown "root:root" "${target}/scan-view" &&
- chmod 0755 "${target}/scan-view" &&
-
- for i in ccc-analyzer c++-analyzer scan-build scan-view; do
- chown "root:root" "${INSTALL_ROOT}/usr/bin/${i}" &&
- chmod 0755 "${INSTALL_ROOT}/usr/bin/${i}"
- done &&
-
- for i in scanview.css sorttable.js; do
- chown "root:root" "${target}/scan-build/${i}" &&
- chmod 0644 "${target}/scan-build/${i}"
- done &&
-
- for i in Reporter.py ScanView.py startfile.py; do
- chown "root:root" "${target}/scan-view/${i}" &&
- chmod 0644 "${target}/scan-view/${i}"
- done &&
-
- chown "root:root" "${INSTALL_ROOT}/usr/share/man/man1/scan-build.1" &&
- chmod 0644 "${INSTALL_ROOT}/usr/share/man/man1/scan-build.1"
-fi
diff --git a/devel/llvm/HISTORY b/devel/llvm/HISTORY
index e63573f..9e841f9 100644
--- a/devel/llvm/HISTORY
+++ b/devel/llvm/HISTORY
@@ -1,3 +1,13 @@
+2025-01-04 Jutsin Boffemmyer <flux AT sourcemage.org>
+ * BUILD,DETAILS,PREPARE,PRE_BUILD: fix, restructure, add some missing
+ supported features
+ * CONFIGURE: add "all" target option
+ * DEPENDS: change options from 1,0 to ON,OFF
+ * FINAL: remove, perform in INSTALL
+ * INSTALL: set ownership and permissions
+ * PRE_SUB_DEPENDS: account for "all" targets
+ * SUB_DEPENDS: fix quoting and phrasing
+
2024-12-18 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 19.1.6

diff --git a/devel/llvm/INSTALL b/devel/llvm/INSTALL
index e4b9fdb..27ba754 100755
--- a/devel/llvm/INSTALL
+++ b/devel/llvm/INSTALL
@@ -6,34 +6,33 @@ if [[ "$LLVM_WITH_ANALYZER" == "y" ]]
then
target="$INSTALL_ROOT/usr/share/llvm" &&

- cd $SOURCE_DIRECTORY/tools/clang/tools &&
+ cd "$SOURCE_DIRECTORY/clang/tools" &&

- install -v -d "$target/scan-build" &&
+ install -v -o root -g root -m 0755 -d "$target/scan-build" &&

for i in ccc-analyzer c++-analyzer; do
- install -v -t "${INSTALL_ROOT}/usr/bin/" scan-build/libexec/${i}
+ install -v -o root -g root -m 0755 -t "${INSTALL_ROOT}/usr/bin/"
scan-build/libexec/${i}
done &&

for i in build view; do
- install -v -t "${INSTALL_ROOT}/usr/bin/" scan-${i}/bin/scan-${i}
+ install -v -o root -g root -m 0755 -t "${INSTALL_ROOT}/usr/bin/"
scan-${i}/bin/scan-${i}
done &&

ln -sf "/usr/bin/ccc-analyzer" "${INSTALL_ROOT}/usr/bin/c++-analyzer" &&

for i in scanview.css sorttable.js; do
- install -v -t "$target/scan-build" scan-build/share/scan-build/${i}
+ install -v -o root -g root -m 0644 -t "$target/scan-build"
scan-build/share/scan-build/${i}
done &&

- install -v -d "$target/scan-view" &&
+ install -v -o root -g root -m 0755 -d "$target/scan-view" &&

for i in Reporter.py ScanView.py startfile.py; do
- install -v -t "$target/scan-view" scan-view/share/${i}
+ install -v -o root -g root -m 0644 -t "$target/scan-view"
scan-view/share/${i}
done &&

- install -v -t "${INSTALL_ROOT}/usr/share/man/man1/"
scan-build/man/scan-build.1
+ install -v -o root -g root -m 0644 -t
"${INSTALL_ROOT}/usr/share/man/man1/" scan-build/man/scan-build.1
fi &&

if [[ "$LLVM_WITH_CLANG" == y ]] && spell_ok python3; then
- cd "${SOURCE_DIRECTORY}" &&
- cp -Rv "${SOURCE_DIRECTORY}/tools/clang/bindings/python/clang"
"${INSTALL_ROOT}/usr/lib/python$(installed_version python3 | cut -f1,2 -d.)/"
+ cp -Rv "${SOURCE_DIRECTORY}/clang/bindings/python/clang"
"${INSTALL_ROOT}/usr/lib/python$(installed_version python3 | cut -f1,2 -d.)/"
fi
diff --git a/devel/llvm/PREPARE b/devel/llvm/PREPARE
index 53c46bb..8a31859 100755
--- a/devel/llvm/PREPARE
+++ b/devel/llvm/PREPARE
@@ -1,5 +1,44 @@
-config_query LLVM_WITH_RTTI "Enable RTTI? (recommended)" y &&
-config_query LLVM_WITH_CLANG "Enable clang compiler frontend?" n &&
-config_query LLVM_WITH_LLDB "Enable lldb debugger?" n &&
-config_query LLVM_WITH_POLLY "Enable polihedral optimizer?" n &&
-config_query LLVM_WITH_LLD "Enable llvm's linker?" n
+. $GRIMOIRE/config_query_multi.function &&
+
+LLVM_ALL_RUNTIMES="all" &&
+LLVM_ALL_RUNTIMES="$LLVM_ALL_RUNTIMES compiler-rt" &&
+LLVM_ALL_RUNTIMES="$LLVM_ALL_RUNTIMES libcxx" &&
+LLVM_ALL_RUNTIMES="$LLVM_ALL_RUNTIMES libcxxabi" &&
+LLVM_ALL_RUNTIMES="$LLVM_ALL_RUNTIMES libunwind" &&
+LLVM_ALL_RUNTIMES="$LLVM_ALL_RUNTIMES openmp" &&
+
+config_query_multi LLVM_RUNTIMES "which runtime library targets?" \
+ $LLVM_ALL_RUNTIMES &&
+
+# selecting "all" runtimes in the LLVM build system will only enable libcxx,
+# libcxxabi, and libunwind, instead of actually all possible supported
+# runtimes, so specify them manually
+if list_find "$LLVM_RUNTIMES" "all" ;then
+ LLVM_RUNTIMES="${LLVM_ALL_RUNTIMES#all }"
+fi &&
+
+config_query LLVM_WITH_RTTI "Enable RTTI? (recommended)" y &&
+config_query LLVM_WITH_BOLT "Enable BOLT?" n &&
+config_query LLVM_WITH_CLANG "Enable clang compiler frontend? (selects
compiler-rt runtime)" n &&
+config_query LLVM_WITH_LLDB "Enable lldb debugger (selects libcxx and
libcxxabi runtimes)?" n &&
+config_query LLVM_WITH_POLLY "Enable polyhedral optimizer (polly)?" n &&
+config_query LLVM_WITH_LLD "Enable llvm's linker (lld)?" n &&
+config_query LLVM_WITH_MLIR "Enable llvm's MLIR?" n &&
+
+if [[ "$LLVM_WITH_CLANG" == y ]] ;then
+ for required in compiler-rt ;do
+ if ! list_find "$LLVM_RUNTIMES" "$required";then
+ LLVM_RUNTIMES="$LLVM_RUNTIMES $required"
+ fi
+ done
+fi &&
+
+if [[ "$LLVM_WITH_LLD" == y ]] ;then
+ for required in libcxx libcxxabi libunwind ;do
+ if ! list_find "$LLVM_RUNTIMES" "$required";then
+ LLVM_RUNTIMES="$LLVM_RUNTIMES $required"
+ fi
+ done
+fi &&
+
+persistent_add LLVM_RUNTIMES
diff --git a/devel/llvm/PRE_BUILD b/devel/llvm/PRE_BUILD
index 721c301..bc9878c 100755
--- a/devel/llvm/PRE_BUILD
+++ b/devel/llvm/PRE_BUILD
@@ -1,52 +1,82 @@
-default_pre_build &&
+mk_source_dir "$SOURCE_DIRECTORY" &&
cd "$SOURCE_DIRECTORY" &&
-unpack_file 21 &&
-mv cmake-${VERSION}.src/Modules cmake &&
-sed '/LLVM_COMMON_CMAKE_UTILS /s;\.\./;;' -i CMakeLists.txt &&
-if [[ "$LLVM_WITH_CLANG" == y ]]; then
+
+unpack_file &&
+mv llvm-${VERSION}.src llvm &&
+
+unpack_file 3 &&
+mv cmake-${VERSION}.src cmake &&
+
+if [[ "$LLVM_WITH_BOLT" == y ]]; then
unpack_file 5 &&
- mv compiler-rt-${VERSION}.src runtimes/compiler-rt &&
- unpack_file 3 &&
- mv clang-${VERSION}.src tools/clang &&
+ mv bolt-${VERSION}.src bolt &&
+ ln -s ../../bolt llvm/tools/bolt
+fi &&
+
+if [[ "$LLVM_WITH_CLANG" == y ]]; then
+ unpack_file 7 &&
+ mv clang-${VERSION}.src clang &&
+ ln -s ../../clang llvm/tools/clang &&
unpack_file 9 &&
- mv clang-tools-extra-${VERSION}.src tools/clang/tools/extra &&
- apply_patch_dir patches-clang &&
- sedit '/^[\t ]*set(model_compiler
/{s@[.][.]/clang-tools-@tools/clang/tools/@}' \
- tools/clang/tools/extra/clangd/quality/CompletionModel.cmake
+ mv clang-tools-extra-${VERSION}.src clang-tools-extra &&
+ ln -s ../../clang-tools-extra clang/tools/extra
+fi &&
+
+if [[ "$LLVM_WITH_LLD" == y ]]; then
+ unpack_file 11 &&
+ mv lld-${VERSION}.src lld &&
+ ln -s ../../lld llvm/tools/lld
fi &&

if [[ "$LLVM_WITH_LLDB" == y ]]; then
- unpack_file 7 &&
- mv lldb-${VERSION}.src tools/lldb &&
- apply_patch_dir patches-lldb
+ unpack_file 13 &&
+ mv lldb-${VERSION}.src lldb &&
+ ln -s ../../lldb llvm/tools/lldb
+fi &&
+
+if [[ "$LLVM_WITH_MLIR" == y ]]; then
+ unpack_file 15 &&
+ mv mlir-${VERSION}.src mlir &&
+ ln -s ../../mlir llvm/tools/mlir
fi &&

if [[ "$LLVM_WITH_POLLY" == y ]]; then
- unpack_file 11 &&
- mv polly-${VERSION}.src tools/polly
+ unpack_file 17 &&
+ mv polly-${VERSION}.src polly &&
+ ln -s ../../polly llvm/tools/polly
fi &&

-if [[ "$LLVM_WITH_LLD" == y ]]; then
- unpack_file 13 &&
- mv lld-${VERSION}.src tools/lld &&
- unpack_file 15 &&
- mv libunwind-${VERSION}.src libunwind &&
- unpack_file 17 &&
- mv libcxx-${VERSION}.src runtimes/libcxx &&
- unpack_file 19 &&
- mv libcxxabi-${VERSION}.src runtimes/libcxxabi &&
- apply_patch_dir patches-lld
+if [[ -n "$LLVM_RUNTIMES" ]] ;then
+ unpack_file 19 &&
+ mv runtimes-${VERSION}.src runtimes
fi &&

-cd "$SOURCE_DIRECTORY" &&
+if list_find "$LLVM_RUNTIMES" "compiler-rt"; then
+ unpack_file 21 &&
+ mv compiler-rt-${VERSION}.src compiler-rt &&
+ ln -s ../../compiler-rt llvm/runtimes/compiler-rt
+fi &&

-# small cmake related fix for libffi
-if spell_ok libffi;then
- FFI=`pkg-config --cflags-only-I libffi` &&
- FFI=${FFI//-I/} &&
- FFI=${FFI//\ */} &&
- sed -i "/FFI_I/s|\"\"|\"$FFI\"|" CMakeLists.txt
-fi &&
+if list_find "$LLVM_RUNTIMES" "libcxx"; then
+ unpack_file 23 &&
+ mv libcxx-${VERSION}.src libcxx &&
+ ln -s ../../libcxx llvm/runtimes/libcxx
+fi &&
+
+if list_find "$LLVM_RUNTIMES" "libcxxabi"; then
+ unpack_file 25 &&
+ mv libcxxabi-${VERSION}.src libcxxabi &&
+ ln -s ../../libcxxabi llvm/runtimes/libcxxabi
+fi &&
+
+if list_find "$LLVM_RUNTIMES" "libunwind"; then
+ unpack_file 27 &&
+ mv libunwind-${VERSION}.src libunwind &&
+ ln -s ../../libunwind llvm/runtimes/libunwind
+fi &&

-# do not build all backends
-sed -i "/^set.*all\"$/s/all//" CMakeLists.txt
+if list_find "$LLVM_RUNTIMES" "openmp"; then
+ unpack_file 29 &&
+ mv openmp-${VERSION}.src openmp &&
+ ln -s ../../openmp llvm/runtimes/openmp
+fi
diff --git a/devel/llvm/PRE_SUB_DEPENDS b/devel/llvm/PRE_SUB_DEPENDS
index d4ef942..a7ad716 100755
--- a/devel/llvm/PRE_SUB_DEPENDS
+++ b/devel/llvm/PRE_SUB_DEPENDS
@@ -1,13 +1,16 @@
-case $THIS_SUB_DEPENDS in
-TARGET-*) list_find "$LLVM_TARGETS" "${THIS_SUB_DEPENDS#TARGET-}" ;;
-AMD) list_find "${LLVM_TARGETS}" AMDGPU ;;
-CLANG) [[ "${LLVM_WITH_CLANG}" == "y" ]] ;;
-LLDB) [[ "${LLVM_WITH_LLDB}" == "y" ]] ;;
-POLLY) [[ "${LLVM_WITH_POLLY}" == "y" ]] ;;
-LLD) [[ "${LLVM_WITH_LLD}" == "y" ]] ;;
-RTTI) [[ y == "$LLVM_WITH_RTTI" ]] ;;
- *)
- message "${PROBLEM_COLOR}bogus sub_depends: $SPELL
$THIS_SUB_DEPENDS${DEFAULT_COLOR}"
- return 1
-;;
+case "$THIS_SUB_DEPENDS" in
+ TARGET-*)
+ list_find "$LLVM_TARGETS" "all" ||
+ list_find "$LLVM_TARGETS" "${THIS_SUB_DEPENDS#TARGET-}"
+ ;;
+ AMD) list_find "${LLVM_TARGETS}" AMDGPU ;;
+ CLANG) [[ "${LLVM_WITH_CLANG}" == "y" ]] ;;
+ LLDB) [[ "${LLVM_WITH_LLDB}" == "y" ]] ;;
+ POLLY) [[ "${LLVM_WITH_POLLY}" == "y" ]] ;;
+ LLD) [[ "${LLVM_WITH_LLD}" == "y" ]] ;;
+ RTTI) [[ y == "$LLVM_WITH_RTTI" ]] ;;
+ *)
+ message "${PROBLEM_COLOR}bogus sub_depends: $SPELL
$THIS_SUB_DEPENDS${DEFAULT_COLOR}"
+ return 1
+ ;;
esac
diff --git a/devel/llvm/SUB_DEPENDS b/devel/llvm/SUB_DEPENDS
index b9aee09..616de9c 100755
--- a/devel/llvm/SUB_DEPENDS
+++ b/devel/llvm/SUB_DEPENDS
@@ -1,7 +1,7 @@
-case $THIS_SUB_DEPENDS in
+case "$THIS_SUB_DEPENDS" in
TARGET-*)
target="${THIS_SUB_DEPENDS#TARGET-}"
- message "${MESSAGE_COLOR}$target target support enforced by
subdep.$DEFAULT_COLOR"
+ message "${MESSAGE_COLOR}$target target support enforced by
sub-dependency.$DEFAULT_COLOR"
list_add LLVM_TARGETS "$target"
;;
AMD)


  • [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (f493c1de298cab2a5b129b0c9676874faa3ef551), Justin Boffemmyer, 01/04/2025

Archive powered by MHonArc 2.6.24.

Top of Page