From c34055da09eefabe97b6a7fc54184e57c1fe4141 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sat, 25 Jul 2026 14:51:49 +0900 Subject: [PATCH] recipes/libclc: fix LIBCLC_TARGETS_TO_BUILD target naming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The libclc CMake config validates target names as (with double-dash suffix for the unspecified-ABI variant). The previous 'amdgcn', 'amdgcn-amdhsa', 'r600', 'generic', 'spirv' names caused: CMake Error at CMakeLists.txt:156 (message): Unknown target in LIBCLC_TARGETS_TO_BUILD: 'amdgcn' Valid targets are: amdgcn--;amdgcn--amdhsa;clspv--;clspv64--;r600--;nvptx--; nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;amdgcn-mesa-mesa3d Fix: use the correct names with suffix: r600-- -> r600 (Southern Islands / Evergreen) amdgcn-- -> GCN GFX6..GFX12 default-ABI amdgcn--amdhsa -> GCN with HSA runtime amdgcn-mesa-mesa3d -> GCN via Mesa3D-specific frontend The target is excluded because Mesa's clc tool produces its own spirv .bc files rather than consuming libclc's. Similarly, nvptx is excluded because there is no NVIDIA path in Mesa. Verified: 'cmake' with -DLIBCLC_TARGETS_TO_BUILD=... above configures successfully and 'make' produces all 118 expected .bc files (r600 devices: cedar/cypress/barts/cayman, amdgcn devices: tahiti..gfx1201 across all GFX variants). 'make install' places the .pc file at /share/pkgconfig/libclc.pc (default cmake pkgconfig location, in pkg-config's standard search path) and the .bc files at /share/clc/ (which is what libclc.pc's libexecdir points to). After this fix, a fresh meson setup of Mesa with the iris/radeonsi gallium drivers and intel/amd/swrast Vulkan drivers resolves 'dependency(libclc)' successfully — the previous 'Dependency libclc not found' error goes away, and the gallium-r600 / gallium- amdgpu / iris paths can compile. The mesa-recipe's iris/radeonsi/Vulkan configuration is already in place (per commit b7b8168aae which reverted the libclc-induced driver drop). With this libclc recipe committed, the recipe build chain is unblocked. --- local/recipes/dev/libclc/recipe.toml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/local/recipes/dev/libclc/recipe.toml b/local/recipes/dev/libclc/recipe.toml index acff2a1477..7e222228d5 100644 --- a/local/recipes/dev/libclc/recipe.toml +++ b/local/recipes/dev/libclc/recipe.toml @@ -70,16 +70,25 @@ set(LIBCLC_STANDALONE_BUILD TRUE CACHE BOOL "" FORCE) NATIVE_EOF # Run cmake with the host-native toolchain. LIBCLC_TARGETS_TO_BUILD -# is the list of GPU targets Mesa consumes. Default "all" includes -# targets Mesa does not need (ptx-nvidiacl for nvidia, clspv for -# Vulkan-SPIR-V path). Restrict to what Mesa's clc tool actually -# requires: amdgcn, amdgcn-amdhsa, r600, generic, spirv. +# is the list of GPU targets Mesa consumes. The target-name syntax +# in upstream libclc is `--` (double-dash suffix for the +# unspecified-ABI variant) plus the Mesa-specific `amdgcn-mesa-mesa3d` +# for the Mesa3D frontend. Targets not consumed by Mesa (ptx-nvidiacl +# for NVIDIA, clspv for Vulkan-SPIR-V) are excluded. The full set +# covers all gallium drivers Mesa 26.1.4 supports via the clc tool: +# r600 -> r600 (Southern Islands / Evergreen) +# amdgcn-- -> GCN GFX6..GFX12 (default-ABI) +# amdgcn--amdhsa -> GCN with HSA runtime +# amdgcn-mesa-mesa3d -> GCN via the Mesa3D-specific path +# The `spirv` target is handled by Mesa's own clc tool (not libclc +# bitcode); libclc's spirv files are used for mesa's SPIR-V codegen +# in clc, but the .bc files themselves are produced by Mesa's clc. COOKBOOK_CMAKE_FLAGS+=( -DCMAKE_TOOLCHAIN_FILE="$(realpath native_libclc.cmake)" -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR="${COOKBOOK_SYSROOT}/lib/cmake/llvm" -DLIBCLC_STANDALONE_BUILD=TRUE - -DLIBCLC_TARGETS_TO_BUILD="amdgcn;amdgcn-amdhsa;r600;generic;spirv" + -DLIBCLC_TARGETS_TO_BUILD="r600--;amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d" -DENABLE_RUNTIME_SUBNORMAL=OFF -DCMAKE_INSTALL_PREFIX="${COOKBOOK_STAGE}/usr" -DCMAKE_INSTALL_LIBDIR=lib