lib/SPIRV/CMakeLists.txt:42 (add_llvm_library) -- Generating done (0.0s) CMake Generate step failed. Build files cannot be regenerated correctly. * ERROR: dev-util/spirv-llvm-translator-16.0.0::gentoo failed (configure phase): * cmake failed * * Call stack: ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1_no_multilib-j5-20230316-050014 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-10 [2] x86_64-pc-linux-gnu-12 * clang/llvm (if any): clang version 16.0.0 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/16/bin Configuration file: /etc/clang/clang.cfg /usr/lib/llvm/16 16.0.0 Python 3.10.10 Available Ruby profiles: [1] ruby27 (with Rubygems) [2] ruby30 (with Rubygems) * Available Rust versions: [1] rust-bin-1.68.1 [2] rust-1.68.1 * The following VMs are available for generation-2: 1) Eclipse Temurin JDK 11.0.18_p10 [openjdk-bin-11] *) Eclipse Temurin JDK 17.0.6_p10 [openjdk-bin-17] 3) Eclipse Temurin JDK 8.362_p09 [openjdk-bin-8] 4) Eclipse Temurin JRE 17.0.6_p10 [openjdk-jre-bin-17] Available Java Virtual Machines: [1] openjdk-bin-8 [2] openjdk-bin-11 [3] openjdk-bin-17 system-vm [4] openjdk-jre-bin-17 The Glorious Glasgow Haskell Compilation System, version 9.0.2 php cli (if any): HEAD of ::gentoo commit c6085bc912444325d2c84c455703ca1eb1a6f1d1 Author: Repository mirror & CI <repomirrorci@gentoo.org> Date: Sat Mar 25 01:01:51 2023 +0000 2023-03-25 01:01:51 UTC emerge -qpvO dev-util/spirv-llvm-translator [ebuild NS ] dev-util/spirv-llvm-translator-16.0.0 [15.0.0] USE="tools -test"
Created attachment 858931 [details] emerge-info.txt
Created attachment 858933 [details] dev-util:spirv-llvm-translator-16.0.0:20230325-012931.log
Created attachment 858935 [details] emerge-history.txt.bz2
Created attachment 858937 [details] environment
Created attachment 858939 [details] etc.clang.tar.bz2
Created attachment 858941 [details] etc.portage.tar.bz2
Created attachment 858943 [details] temp.tar.bz2
*** Bug 903099 has been marked as a duplicate of this bug. ***
*** Bug 903019 has been marked as a duplicate of this bug. ***
So I got this working locally, it needed a newer version of spriv-headers (1.3.243) and I'll attach a patch that stops CMake looking for things that are definitely there
Created attachment 859437 [details, diff] Work around I've popped the newer version of spirv-headers and this patch in the FireBurn overlay and I've got Rusticl OpenCL working with Clang 16
@mgorny: Could you have a look at the patch? What are those components?
(In reply to Conrad Kostecki from comment #12) > @mgorny: Could you have a look at the patch? What are those components? The patch probably isn't 100% upstream-correct but it's good enough for Gentoo. Fedora seems to have a "more correct" patch [1] but it's much longer and I'm not sure about it. Components are static libraries. We're building a "dylib" that contains all static libraries combined. Since we're not installing LLVM static libraries, they can't DEPEND on them -- and I'm not sure why they do in the first place, if they clearly account for dylib being linked rather than the static libs. [1] https://src.fedoraproject.org/rpms/spirv-llvm-translator/pull-request/5#request_diff
Created attachment 859534 [details] build.log.gz Unfortunately Mike's patch is not enough for me.
Created attachment 859535 [details] build.log Fedora's patch fails at well with different errors.
Created attachment 859553 [details, diff] static.patch Mike's patch plus the attached one fixed the build for me. More info: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1936#issuecomment-1496563307
Created attachment 859612 [details, diff] Updated patch
A better fix would be the following but it's still waiting for the CLA before being merged upstream: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/1889 Please note that I still didn't test it yet.
Whilst we have all this focus, can we update the ebuild to put the pkgconfig file into /usr/lib64/pkgconfig rather than /usr/lib/llvm/16/lib64/pkgconfig/LLVMSPIRVLib.pc?
And I still need to create a symbolic link to get rusticl to stop complaining about opencl-c-base.h beiing missing ln -s /usr/lib/clang /usr/lib/llvm/16/lib64/clang
You can use PKG_CONFIG_LIBDIR instead: https://github.com/gentoo/gentoo/pull/28209/files#diff-6c473421061cb7b3f14120cd9f34d9e88cb35c258b00e1c776909a25eab0840fR406 But I agree that it would be better without having to do so.
Oh wait I think that's another issue: opencl-c-base.h is way more annoying and needs an out of tree patch which is NOT going to be mainlined: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232#note_1776640 We definitely need a fix for that one because Mesa didn't manage to find a satisfying solution and they're currently consulting with llvm developers to figure out a way to get the path.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d83abc346d4856b7a87a8007b4094f4996056b6 commit 8d83abc346d4856b7a87a8007b4094f4996056b6 Author: Conrad Kostecki <conikost@gentoo.org> AuthorDate: 2023-04-09 19:53:45 +0000 Commit: Conrad Kostecki <conikost@gentoo.org> CommitDate: 2023-04-09 19:55:07 +0000 dev-util/spirv-llvm-translator: fix build Closes: https://bugs.gentoo.org/903017 Signed-off-by: Conrad Kostecki <conikost@gentoo.org> ...vm-translator-16.0.0-llvm-link-llvm-dylib.patch | 73 ++++++++++++++++++++++ .../spirv-llvm-translator-16.0.0.ebuild | 2 + profiles/package.mask | 4 -- 3 files changed, 75 insertions(+), 4 deletions(-)