recipes/libclc: fix LIBCLC_TARGETS_TO_BUILD target naming

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.
This commit is contained in:
2026-07-25 14:51:49 +09:00
parent f26371ae30
commit c34055da09
+14 -5
View File
@@ -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 `<triple>--` (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