Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955950 - llvm-core/libclc: doesn't select correct LLVM ROOT (SPIR-V targets requested, but spirv-tools is not installed)
Summary: llvm-core/libclc: doesn't select correct LLVM ROOT (SPIR-V targets requested,...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-14 10:42 UTC by Benjamin Block
Modified: 2025-05-16 13:58 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
llvm-root.patch (llvm-root.patch,404 bytes, patch)
2025-05-14 10:43 UTC, Benjamin Block
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Block 2025-05-14 10:42:15 UTC
When `dev-util/spirv-llvm-translator` is not installed with the latest slot, `llvm-core/libclc` won't find it because it only considers the latest slot.

So e.g. when I have LLVM 19 and 20 installed due to dependencies, and `dev-util/spirv-llvm-translator` is only installed for LLVM 19, but not 20, this happens during configure:

>>> Configuring source in /home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc ...
 * Source directory (CMAKE_USE_DIR): "/home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc"
 * Build directory  (BUILD_DIR):     "/home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc_build"
cmake -C /home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/home/share/gentoo/usr -DLIBCLC_TARGETS_TO_BUILD=spirv-mesa3d-;spirv64-mesa3d-;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc_build/gentoo_toolchain.cmake /home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc
loading initial cache file /home/share/gentoo/var/tmp/portage/llvm-core/libclc-19.1.7/work/libclc_build/gentoo_common_config.cmake
-- The CXX compiler identification is GNU 15.1.0
-- The C compiler identification is GNU 15.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/share/gentoo/usr/bin/x86_64-pc-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/share/gentoo/usr/bin/x86_64-pc-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /home/share/gentoo/usr/lib64/libffi.so
-- Found ZLIB: /home/share/gentoo/usr/lib64/libz.so (found version "1.3.1")
-- Found zstd: /home/share/gentoo/usr/lib64/libzstd.so
-- Found LibXml2: /home/share/gentoo/usr/lib64/libxml2.so (found version "2.13.8")
-- Linker detection: GNU ld
-- libclc LLVM version: 20.1.4
CMake Error at CMakeLists.txt:148 (message):
  SPIR-V targets requested, but spirv-tools is not installed

The problem here is: `libclc LLVM version: 20.1.4`, which will then make it search for SPIR-V in the wrong folders.

AFAICT the ebuild is missing `CMAKE_INSTALL_PREFIX` and/or `LLVM_ROOT` in `mycmakeargs[]`; but I'm not expert.

Reproducible: Always
Comment 1 Benjamin Block 2025-05-14 10:43:45 UTC
Created attachment 928794 [details, diff]
llvm-root.patch

This seems to work, but I'm not sure what the implications are, so I wouldn't trust it without more knowledge.