Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/llvm-project/libclc: fix build with llvm 23
@ 2026-10-13 21:58 Bernd Kuhls
  2026-10-13 21:58 ` [Buildroot] [PATCH 2/2] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
  2026-10-15 20:14 ` [Buildroot] [PATCH 1/2] package/llvm-project/libclc: fix build with llvm 23 Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2026-10-13 21:58 UTC (permalink / raw)
  To: buildroot; +Cc: Daniel Lang, Romain Naour, Valentin Korenblit

Buildroot commit 5f79161e4a8756acdb25c8500de9b2dee663f2ac bumped the
llvm packages from 22.1.8 to 23.1.0 causing configure errors with the
libclc package:

-- Check for working CLC compiler: /usr/bin/gcc
CMake Error at cmake/modules/CMakeTestCLCCompiler.cmake:29 (message):
  The CLC compiler

    /usr/bin/gcc

  is not able to compile a simple OpenCL test program.

  Output:

  gcc: error: unrecognized command-line option
  '--target=spirv64-unknown-unknown'

Update various configure options to detect the correct host compiler.

Add post install hooks to create symlink which is needed for mesa3d to
detect libclc.
Fixes tests.package.test_mesa3d.TestMesa3DRusticl.test_run:

Libclc failed to load. Please make sure it is installed and provides
                spirv-mesa3d-.spv and/or spirv64-mesa3d-.spv

For details see
https://gitlab.archlinux.org/archlinux/packaging/packages/libclc/-/commit/ca75c4b19c76ae856a368d070d914b12f71203a5#line_9b9baac1e_A71

Fixes:
https://autobuild.buildroot.net/results/3fc/3fcdcb71be590b090df2f765c68aeaecc44dd215/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 package/llvm-project/libclc/libclc.mk | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/package/llvm-project/libclc/libclc.mk b/package/llvm-project/libclc/libclc.mk
index ff00871747..cefdca63d4 100644
--- a/package/llvm-project/libclc/libclc.mk
+++ b/package/llvm-project/libclc/libclc.mk
@@ -36,13 +36,28 @@ LIBCLC_CONF_OPTS = \
 	-DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \
 	-DCMAKE_SHARED_LINKER_FLAGS="$(HOST_LDFLAGS)" \
 	-DCMAKE_MODULE_LINKER_FLAGS="$(HOST_LDFLAGS)" \
-	-DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
-	-DCMAKE_CXX_COMPILER="$(CMAKE_HOST_CXX_COMPILER)" \
+	-DCMAKE_C_COMPILER="$(HOST_DIR)/bin/clang" \
+	-DCMAKE_CXX_COMPILER="$(HOST_DIR)/bin/clang" \
 	-DLLVM_CMAKE_DIR="$(HOST_DIR)/lib/cmake/llvm" \
+	-DLIBCLC_TARGET=spirv64-unknown-unknown \
 	-DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR="$(HOST_DIR)/bin"
 
 HOST_LIBCLC_CONF_OPTS = \
-	-DLIBCLC_TARGETS_TO_BUILD=spirv64-mesa3d-
+	-DCMAKE_C_COMPILER_FORCED=ON \
+	-DCMAKE_CXX_COMPILER_FORCED=ON \
+	-DCMAKE_C_COMPILER="$(HOST_DIR)/bin/clang" \
+	-DCMAKE_CXX_COMPILER="$(HOST_DIR)/bin/clang" \
+	-DLIBCLC_TARGET=spirv64-unknown-unknown
+
+define LIBCLC_LINK_STAGING_SPV
+	ln -sf spirv64-unknown-unknown/libclc.spv $(STAGING_DIR)/usr/share/clc/spirv64-mesa3d-.spv
+endef
+LIBCLC_POST_INSTALL_STAGING_HOOKS += LIBCLC_LINK_STAGING_SPV
+
+define LIBCLC_LINK_TARGET_SPV
+	ln -sf spirv64-unknown-unknown/libclc.spv $(TARGET_DIR)/usr/share/clc/spirv64-mesa3d-.spv
+endef
+LIBCLC_POST_INSTALL_TARGET_HOOKS += LIBCLC_LINK_TARGET_SPV
 
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-15 20:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 21:58 [Buildroot] [PATCH 1/2] package/llvm-project/libclc: fix build with llvm 23 Bernd Kuhls
2026-10-13 21:58 ` [Buildroot] [PATCH 2/2] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
2026-10-15 20:14 ` [Buildroot] [PATCH 1/2] package/llvm-project/libclc: fix build with llvm 23 Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox