Skip to Content.
Sympa Menu

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

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 (bf04d3e8d72eea847ba624ee059e5003db9b7aea)
  • Date: Sun, 2 Mar 2025 11:05:01 +0000

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

devel/llvm/BUILD | 10 +++++++++-
devel/llvm/HISTORY | 4 ++++
devel/llvm/PREPARE | 6 ++++++
3 files changed, 19 insertions(+), 1 deletion(-)

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

devel/llvm: improve libclc workaround handling

Explicitly warn the user in PREPARE that selecting libclc SPIR-V targets
will require llvm-spirv to already be present on the system. Also, if
the llvm-spirv command is not available in BUILD, present an error to
the user with a suggestion of how to successfully cast llvm with libclc
SPIR-V support and abort the build (it would later fail anyway).

This workaround is very inelegant, but this bug should only be temporary
upstream, and the present method in the spell avoids the creation of
persistent variables that are only relevant for the temporary workaround
while also providing maximum flexibility to the end user of how to
configure their LLVM.

diff --git a/devel/llvm/BUILD b/devel/llvm/BUILD
index 35a7b61..d654b17 100755
--- a/devel/llvm/BUILD
+++ b/devel/llvm/BUILD
@@ -59,7 +59,15 @@ fi &&

# workaround for https://github.com/llvm/llvm-project/issues/109537
if [[ "$LLVM_WITH_LIBCLC" == y ]] ;then
- OPTS="$OPTS -DLLVM_SPIRV=$(command -v llvm-spirv || true)"
+ local spirvcmd="$(command -v llvm-spirv)"
+ if [ -z "$spirvcmd" ] ;then
+ message "${PROBLEM_COLOR}libclc with SPIR-V support requires llvm-spirv
(https://github.com/llvm/llvm-project/issues/109537),${NORMAL_COLOR}"
+ message "${PROBLEM_COLOR}but llvm-spirv was not found in your
system.${NORMAL_COLOR}"
+ message "${PROBLEM_COLOR}Cast llvm with SPIR-V but without libclc
once,${NORMAL_COLOR}"
+ message "${PROBLEM_COLOR}then you may recast (cast -r) with libclc also
enabled.${NORMAL_COLOR}"
+ return 1
+ fi &&
+ OPTS="$OPTS -DLLVM_SPIRV=$spirvcmd"
fi &&

if [[ "$LLVM_WITH_LLD" == y ]] ;then
diff --git a/devel/llvm/HISTORY b/devel/llvm/HISTORY
index 4573dd0..d5b361f 100644
--- a/devel/llvm/HISTORY
+++ b/devel/llvm/HISTORY
@@ -1,3 +1,7 @@
+2025-03-02 Justin Boffemmyer <flux AT sourcemage.org>
+ * BUILD, PREPARE: explicitly warn the user about libclc SPIR-V builds
+ needing llvm-spirv
+
2025-02-28 Thomas Orgis <sobukus AT sourcemage.org>
* BUILD: fix the && chain and make a non-existing llvm-spirv non-fatal
* DETAILS: ++PATCHLEVEL, as this changes the build (for example,
really
diff --git a/devel/llvm/PREPARE b/devel/llvm/PREPARE
index 2333b1a..318caa7 100755
--- a/devel/llvm/PREPARE
+++ b/devel/llvm/PREPARE
@@ -118,6 +118,12 @@ config_query LLVM_WITH_FLANG "Build the flang fortran
frontend (selects MLIR)
if [[ "$LLVM_WITH_CLANG" == y ]] ;then
config_query LLVM_WITH_LIBCLC "Build the LLVM OpenCL implementation
(libclc)?" n &&
if [[ "$LLVM_WITH_LIBCLC" == y ]] ;then
+ # warning messages for https://github.com/llvm/llvm-project/issues/109537
+ message "${MESSAGE_COLOR}Building libclc with SPIR-V support currently
requires (https://github.com/llvm/llvm-project/issues/109537)${NORMAL_COLOR}"
&&
+ message "${MESSAGE_COLOR}llvm-spirv to already be available on the
system.${NORMAL_COLOR}" &&
+ message "${MESSAGE_COLOR}If you do not yet have llvm-spirv and want
libclc SPIR-V support,${NORMAL_COLOR}" &&
+ message "${MESSAGE_COLOR}cast llvm once without libclc but with LLVM
SPIR-V enabled, then${NORMAL_COLOR}" &&
+ message "${MESSAGE_COLOR}recast (cast -r) with both LLVM SPIR-V and
libclc (with SPIR-V targets) enabled.${NORMAL_COLOR}" &&
config_query_multi LLVM_LIBCLC_TARGETS \
"Which libclc targets to build?" \
$libclc_targets


  • [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (bf04d3e8d72eea847ba624ee059e5003db9b7aea), Justin Boffemmyer, 03/02/2025

Archive powered by MHonArc 2.6.24.

Top of Page