Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923826 - media-libs/mesa-24.0.0: compile failed - undefined reference to clang::getClangFullVersion()
Summary: media-libs/mesa-24.0.0: compile failed - undefined reference to clang::getCla...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
: 928601 947399 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-02-05 12:17 UTC by Stefan Schmid
Modified: 2025-01-29 21:22 UTC (History)
12 users (show)

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


Attachments
build.log for media-libs/mesa-24.0.0 (build_mesa-24.0.0.tar.gz,105.85 KB, application/gzip)
2024-02-05 12:18 UTC, Stefan Schmid
Details
emerge --info (emerge_info.txt,8.46 KB, text/plain)
2024-02-05 12:18 UTC, Stefan Schmid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Schmid 2024-02-05 12:17:52 UTC
Build of "media-libs/mesa-24.0.0" fails reproducibly.

/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/frontends/rusticl/librusticl.a(rusticl.rusticl.a47c5595081e634a-cgu.06.rcgu.o): in function `rusticl::core::program::get_disk_cache':
rusticl.a47c5595081e634a-cgu.06:(.text._ZN7rusticl4core7program14get_disk_cache17h48ec0ac8c9b41030E+0x1e): undefined reference to `clang::getClangFullVersion()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: rusticl.a47c5595081e634a-cgu.06:(.text._ZN7rusticl4core7program14get_disk_cache17h48ec0ac8c9b41030E+0x2a): undefined reference to `llvm::writeSpirv(llvm::Module*, SPIRV::TranslatorOpts const&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

# /etc/portage/package.use/media-libs
media-libs/mesa d3d9 gles1 osmesa xa xvmc zink

# /etc/portage/profile/package.use.mask
media-libs/mesa -zink

In Attachment
- emerge --info
- build.log of media-libs/mesa-24.0.0

Reproducible: Always
Comment 1 Stefan Schmid 2024-02-05 12:18:26 UTC
Created attachment 884270 [details]
build.log for media-libs/mesa-24.0.0
Comment 2 Stefan Schmid 2024-02-05 12:18:45 UTC
Created attachment 884271 [details]
emerge --info
Comment 3 Attila Tóth 2024-02-07 08:02:31 UTC
Reverting commit 33673bcc as per the referenced bug still not enough to make it compile.

llvm-config --version
17.0.6

clang --version
clang version 17.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg

gcc --version
gcc (Gentoo Hardened 13.2.1_p20240113-r1 p12) 13.2.1 20240113


[2321/2321] x86_64-pc-linux-gnu-g++  -o src/gallium/targets/rusticl/libRusticlOpenCL.so.1.0.0 src/gallium/targets/rusticl/libRusticlOpenCL.so.1.0.0.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libRusticlOpenCL.so.1 -Wl,--whole-archive src/gallium/frontends/rusticl/librusticl.a -Wl,--no-whole-archive -O2 -march=native -pipe -Wl,-O1 -Wl,--as-needed -Wl,-rpath,/usr/lib/llvm/17/lib64 -Wl,-rpath-link,/usr/lib/llvm/17/lib64 src/gallium/auxiliary/libgalliumvl.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/null/libws_null.a src/gallium/drivers/iris/libiris.a src/gallium/drivers/iris/libiris_per_hw_ver80.a src/gallium/drivers/iris/libiris_per_hw_ver90.a src/gallium/drivers/iris/libiris_per_hw_ver110.a src/gallium/drivers/iris/libiris_per_hw_ver120.a src/gallium/drivers/iris/libiris_per_hw_ver125.a src/gallium/drivers/iris/libiris_per_hw_ver200.a src/intel/compiler/libintel_compiler.a src/intel/dev/libintel_dev.a src/intel/isl/libisl.a src/intel/isl/libisl_per_hw_ver40.a src/intel/isl/libisl_per_hw_ver50.a src/intel/isl/libisl_per_hw_ver60.a src/intel/isl/libisl_per_hw_ver70.a src/intel/isl/libisl_per_hw_ver75.a src/intel/isl/libisl_per_hw_ver80.a src/intel/isl/libisl_per_hw_ver90.a src/intel/isl/libisl_per_hw_ver110.a src/intel/isl/libisl_per_hw_ver120.a src/intel/isl/libisl_per_hw_ver125.a src/intel/isl/libisl_per_hw_ver200.a src/intel/isl/libisl_tiled_memcpy.a src/intel/isl/libisl_tiled_memcpy_sse41.a src/intel/blorp/libblorp.a src/intel/perf/libintel_perf.a src/intel/common/libintel_common.a src/intel/common/libintel_clflushopt.a src/intel/ds/libintel-driver-ds.a src/gallium/winsys/iris/drm/libiriswinsys.a src/gallium/drivers/r600/libr600.a src/mesa/libmesa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/mesa/libmesa_sse41.a src/compiler/spirv/libvtn.a src/gallium/winsys/radeon/drm/libradeonwinsys.a src/gallium/drivers/radeonsi/libradeonsi_gfx6.a src/amd/compiler/libaco.a src/gallium/drivers/radeonsi/libradeonsi_gfx7.a src/gallium/drivers/radeonsi/libradeonsi_gfx8.a src/gallium/drivers/radeonsi/libradeonsi_gfx9.a src/gallium/drivers/radeonsi/libradeonsi_gfx10.a src/gallium/drivers/radeonsi/libradeonsi_gfx103.a src/gallium/drivers/radeonsi/libradeonsi_gfx11.a src/gallium/drivers/radeonsi/libradeonsi_gfx115.a src/gallium/drivers/radeonsi/libradeonsi.a src/gallium/winsys/amdgpu/drm/libamdgpuwinsys.a src/amd/addrlib/libaddrlib.a src/amd/common/libamd_common.a src/amd/llvm/libamd_common_llvm.a src/amd/vpelib/liblibvpe.a.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a src/gallium/frontends/rusticl/liblibc_rust_gen.rlib src/gallium/frontends/rusticl/libmesa_rust.rlib src/gallium/frontends/rusticl/libmesa_rust_gen.rlib src/gallium/auxiliary/libgallium.a src/compiler/clc/liblibmesaclc.a src/gallium/frontends/rusticl/libmesa_rust_util.rlib src/gallium/frontends/rusticl/libmesa_bindings_inline_wrapper.a src/gallium/frontends/rusticl/libsystem_bindings.a src/gallium/frontends/rusticl/librusticl_llvm_gen.rlib src/gallium/frontends/rusticl/librusticl_opencl_gen.rlib -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script /var/tmp/portage/media-libs/mesa-24.0.0/work/mesa-24.0.0/src/gallium/targets/rusticl/rusticl.sym /usr/lib64/libz.so -pthread -lm /usr/lib64/libzstd.so /usr/lib64/libunwind.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib64/libdrm.so /usr/lib64/libexpat.so /usr/lib64/libxcb.so /usr/lib64/libxcb-randr.so /usr/lib64/libdrm_radeon.so /usr/lib64/libelf.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib64/libdrm_amdgpu.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -lrt -lpthread -ldl -lutil -fPIC -L/usr/lib/llvm/17/lib64 -lLLVM-17 -lsensors /usr/lib/llvm/17/lib64/libclang-cpp.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib/llvm/17/lib64/libLLVMSPIRVLib.so /usr/lib64/libSPIRV-Tools-opt.so /usr/lib64/libSPIRV-Tools.so /usr/lib64/libSPIRV-Tools-link.so -Wl,--end-group
FAILED: src/gallium/targets/rusticl/libRusticlOpenCL.so.1.0.0
x86_64-pc-linux-gnu-g++  -o src/gallium/targets/rusticl/libRusticlOpenCL.so.1.0.0 src/gallium/targets/rusticl/libRusticlOpenCL.so.1.0.0.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libRusticlOpenCL.so.1 -Wl,--whole-archive src/gallium/frontends/rusticl/librusticl.a -Wl,--no-whole-archive -O2 -march=native -pipe -Wl,-O1 -Wl,--as-needed -Wl,-rpath,/usr/lib/llvm/17/lib64 -Wl,-rpath-link,/usr/lib/llvm/17/lib64 src/gallium/auxiliary/libgalliumvl.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/null/libws_null.a src/gallium/drivers/iris/libiris.a src/gallium/drivers/iris/libiris_per_hw_ver80.a src/gallium/drivers/iris/libiris_per_hw_ver90.a src/gallium/drivers/iris/libiris_per_hw_ver110.a src/gallium/drivers/iris/libiris_per_hw_ver120.a src/gallium/drivers/iris/libiris_per_hw_ver125.a src/gallium/drivers/iris/libiris_per_hw_ver200.a src/intel/compiler/libintel_compiler.a src/intel/dev/libintel_dev.a src/intel/isl/libisl.a src/intel/isl/libisl_per_hw_ver40.a src/intel/isl/libisl_per_hw_ver50.a src/intel/isl/libisl_per_hw_ver60.a src/intel/isl/libisl_per_hw_ver70.a src/intel/isl/libisl_per_hw_ver75.a src/intel/isl/libisl_per_hw_ver80.a src/intel/isl/libisl_per_hw_ver90.a src/intel/isl/libisl_per_hw_ver110.a src/intel/isl/libisl_per_hw_ver120.a src/intel/isl/libisl_per_hw_ver125.a src/intel/isl/libisl_per_hw_ver200.a src/intel/isl/libisl_tiled_memcpy.a src/intel/isl/libisl_tiled_memcpy_sse41.a src/intel/blorp/libblorp.a src/intel/perf/libintel_perf.a src/intel/common/libintel_common.a src/intel/common/libintel_clflushopt.a src/intel/ds/libintel-driver-ds.a src/gallium/winsys/iris/drm/libiriswinsys.a src/gallium/drivers/r600/libr600.a src/mesa/libmesa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/mesa/libmesa_sse41.a src/compiler/spirv/libvtn.a src/gallium/winsys/radeon/drm/libradeonwinsys.a src/gallium/drivers/radeonsi/libradeonsi_gfx6.a src/amd/compiler/libaco.a src/gallium/drivers/radeonsi/libradeonsi_gfx7.a src/gallium/drivers/radeonsi/libradeonsi_gfx8.a src/gallium/drivers/radeonsi/libradeonsi_gfx9.a src/gallium/drivers/radeonsi/libradeonsi_gfx10.a src/gallium/drivers/radeonsi/libradeonsi_gfx103.a src/gallium/drivers/radeonsi/libradeonsi_gfx11.a src/gallium/drivers/radeonsi/libradeonsi_gfx115.a src/gallium/drivers/radeonsi/libradeonsi.a src/gallium/winsys/amdgpu/drm/libamdgpuwinsys.a src/amd/addrlib/libaddrlib.a src/amd/common/libamd_common.a src/amd/llvm/libamd_common_llvm.a src/amd/vpelib/liblibvpe.a.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a src/gallium/frontends/rusticl/liblibc_rust_gen.rlib src/gallium/frontends/rusticl/libmesa_rust.rlib src/gallium/frontends/rusticl/libmesa_rust_gen.rlib src/gallium/auxiliary/libgallium.a src/compiler/clc/liblibmesaclc.a src/gallium/frontends/rusticl/libmesa_rust_util.rlib src/gallium/frontends/rusticl/libmesa_bindings_inline_wrapper.a src/gallium/frontends/rusticl/libsystem_bindings.a src/gallium/frontends/rusticl/librusticl_llvm_gen.rlib src/gallium/frontends/rusticl/librusticl_opencl_gen.rlib -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script /var/tmp/portage/media-libs/mesa-24.0.0/work/mesa-24.0.0/src/gallium/targets/rusticl/rusticl.sym /usr/lib64/libz.so -pthread -lm /usr/lib64/libzstd.so /usr/lib64/libunwind.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib64/libdrm.so /usr/lib64/libexpat.so /usr/lib64/libxcb.so /usr/lib64/libxcb-randr.so /usr/lib64/libdrm_radeon.so /usr/lib64/libelf.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib64/libdrm_amdgpu.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 -L/usr/lib/llvm/17/lib64 -lLLVM-17 -lrt -lpthread -ldl -lutil -fPIC -L/usr/lib/llvm/17/lib64 -lLLVM-17 -lsensors /usr/lib/llvm/17/lib64/libclang-cpp.so -L/usr/lib/llvm/17/lib64 -lLLVM-17 /usr/lib/llvm/17/lib64/libLLVMSPIRVLib.so /usr/lib64/libSPIRV-Tools-opt.so /usr/lib64/libSPIRV-Tools.so /usr/lib64/libSPIRV-Tools-link.so -Wl,--end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/frontends/rusticl/librusticl.a(rusticl.rusticl.8232024ab3b6f6d2-cgu.06.rcgu.o): in function `rusticl::core::program::get_disk_cache':
rusticl.8232024ab3b6f6d2-cgu.06:(.text._ZN7rusticl4core7program14get_disk_cache17h761dbc098ab01d02E+0x1e): undefined reference to `clang::getClangFullVersion()'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: rusticl.8232024ab3b6f6d2-cgu.06:(.text._ZN7rusticl4core7program14get_disk_cache17h761dbc098ab01d02E+0x2a): undefined reference to `llvm::writeSpirv(llvm::Module*, SPIRV::TranslatorOpts const&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Comment 4 Attila Tóth 2024-02-11 08:54:19 UTC
Still fails, even with the patch from the other related bug
Comment 5 Attila Tóth 2024-02-11 15:59:48 UTC
(In reply to Attila Tóth from comment #4)
> Still fails, even with the patch from the other related bug

Could it be some kind of a rust vs llvm/clang version mismatch? Something compiled with a different version?
Comment 6 Stefan Schmid 2024-02-11 17:02:29 UTC
(In reply to Attila Tóth from comment #5)
> Could it be some kind of a rust vs llvm/clang version mismatch? Something
> compiled with a different version?

I also tried it with "=dev-lang/rust-1.74.1" (compiled with my own llvm 17) and it gets the same error as with "dev-lang/rust-bin-1.74.1"
Comment 7 Stefan Schmid 2024-02-16 08:43:29 UTC
"media-libs/mesa-24.0.1" has the same problem.
Comment 8 Mark 2024-02-16 22:32:18 UTC
I suspect vulkan/spirv packages are to blame. There is bug #918989 about ffmpeg linker errors after dev-util/spirv-llvm-translator 17.0.0-r2 replaced -r1 because it pulled in newer vulkan headers and stuff that requires patches for linking.
And now we have spirv-llvm messages again in the mesa output.
Comment 9 Attila Tóth 2024-02-17 11:28:48 UTC
Another take on this matter:
src/gallium/frontends/rusticl/rusticl_llvm_bindings.hpp contains
<clang/Basic/Version.h>
<llvm/IR/LLVMContext.h>
<LLVMSPIRVLib/LLVMSPIRVLib.h>

There's no /usr/include/clang or /usr/include/llvm on my system.
clang/Basic/Version.h is located: /usr/lib/llvm/17/include/clang/Basic/Version.h
llvm/IR/LLVMContext.h location: /usr/lib/llvm/17/include/llvm/IR/LLVMContext.h
and LLVMSPIRVLib/LLVMSPIRVLib.h: /usr/lib/llvm/17/include/LLVMSPIRVLib/LLVMSPIRVLib.h.

If I correct the include lines in the source files (build.meson also has a line involved), compile fails with:
/usr/lib/llvm/17/include/clang/Basic/Version.h:18:10: fatal error: 'clang/Basic/Version.inc' file not found
panicked at 'Unable to generate bindings: ClangDiagnostic("/usr/lib/llvm/17/include/clang/Basic/Version.h:18:10: fatal error: 'clang/Basic/Version.inc' file not found\n")', bindgen-cli/main.rs:52:36

If I create symlinks:
/usr/include/clang -> /usr/lib/llvm/17/include/clang
/usr/include/llvm -> /usr/lib/llvm/17/include/llvm
/usr/include/llvm-c -> /usr/lib/llvm/17/include/llvm-c
/usr/include/LLVMSPIRVLib -> /usr/lib/llvm/17/include/LLVMSPIRVLib
/usr/include/clang-c -> /usr/lib/llvm/17/include/clang-c
It still seem to not take into account the headers.

So that I explicitly add rusticl_llvm_bindings.hpp to rusticl_mesa_bindings.h like this:
@@ -1,5 +1,6 @@
 #include "rusticl_mesa_inline_bindings_wrapper.h"
 #include "rusticl_system_bindings.h"
+#include "rusticl_llvm_bindings.hpp"

 #include "compiler/clc/nir_clc_helpers.h"
 #include "compiler/clc/clc.h"

Now there is a compile failure with this:
[2237/2321] <<<snip>>> -DHAVE_DRISW_KMS -DHAVE_LIBSENSORS=1 -MD -MQ ../mesa-24.0.0/src/gallium/frontends/rusticl/rusticl_mesa_bindings.h -MF src/gallium/frontends/rusticl/rusticl_mesa_bindings.h.d
FAILED: src/gallium/frontends/rusticl/rusticl_mesa_bindings.rs
/usr/bin/bindgen ../mesa-24.0.0/src/gallium/frontends/rusticl/rusticl_mesa_bindings.h --output /var/tmp/portage/media-libs/mesa-24.0.0/work/mesa-24.0.0-abi_x86_64.amd64/src/gallium/frontends/rusticl/ <<<snip>>> -MD -MQ ../mesa-24.0.0/src/gallium/frontends/rusticl/rusticl_mesa_bindings.h -MF src/gallium/frontends/rusticl/rusticl_mesa_bindings.h.d
/usr/include/llvm/ADT/DenseMapInfo.h:17:10: fatal error: 'cassert' file not found
panicked at 'Unable to generate bindings: ClangDiagnostic("/usr/include/llvm/ADT/DenseMapInfo.h:17:10: fatal error: 'cassert' file not found\n")', bindgen-cli/main.rs:52:36

DenseMapInfo.h has these includes:
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <tuple>
#include <type_traits>
#include <utility>

OK? I feel uneasy to create symlinks in /usr/include for specific clang/llvm versions. What will be next? Cannot find cstdint? I'm not sure how this must be handled professionally.
I will let this settle for a while.
Comment 10 Attila Tóth 2024-02-17 12:12:46 UTC
I should add, that according to meson.build an rs file should be generated during compilation from rusticl_llvm_bindings.hpp. I don't know why that is not happening in order.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-18 12:10:02 UTC
(In reply to Attila Tóth from comment #9)
> Another take on this matter:
> src/gallium/frontends/rusticl/rusticl_llvm_bindings.hpp contains
> <clang/Basic/Version.h>
> <llvm/IR/LLVMContext.h>
> <LLVMSPIRVLib/LLVMSPIRVLib.h>
> 
> There's no /usr/include/clang or /usr/include/llvm on my system.
> clang/Basic/Version.h is located:
> /usr/lib/llvm/17/include/clang/Basic/Version.h
> llvm/IR/LLVMContext.h location:
> /usr/lib/llvm/17/include/llvm/IR/LLVMContext.h
> and LLVMSPIRVLib/LLVMSPIRVLib.h:
> /usr/lib/llvm/17/include/LLVMSPIRVLib/LLVMSPIRVLib.h.

Those include directives do not imply /usr/include/clang has to exist, because the build system may well pass -I/path/to/them, as Meson should (and I think does) here.
Comment 12 Enne Eziarc 2024-02-27 03:07:25 UTC
I've been wondering whether LLVM_TARGETS could be the cause of this, but I've had no success after many CPU-hours of experimenting.

I noticed llvm_targets_SPIRV isn't set by p.use.force and tried rebuilding all of llvm+clang+rust with it enabled (previously had rust-bin installed like the bug reporter). Also rebuilt everything with vulkan or spirv in the package name afterwards for good measure, in case there was some sort of toolchain bootstrapping problem going on, but it wouldn't budge.

FWIW mesa-24 builds fine with USE=-opencl here, and mesa-23 with it. I'm inclined to just leave it off since no CL apps I've tried actually work with anything but a 5 year old rocm anyway.
Comment 13 Matt Turner gentoo-dev 2024-04-05 14:47:35 UTC
*** Bug 928601 has been marked as a duplicate of this bug. ***
Comment 14 Bogdan 2024-05-06 09:52:20 UTC
Configrm bug with media-libs/mesa-24.0.4
Comment 15 Sven Eden 2024-05-29 09:14:43 UTC
fyi: Bug still present in media-libs/mesa-24.1.0-r1 as:

--------
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/frontends/rusticl/librusticl.a(rusticl.rusticl.5ab74f87658667c1-cgu.12.rcgu.o): in function `rusticl::core::program::get_disk_cache':
rusticl.5ab74f87658667c1-cgu.12:(.text._ZN7rusticl4core7program14get_disk_cache17h3b324f7c00e2720dE+0x1e): undefined reference to `clang::getClangFullVersion()'
--------
Comment 16 Vladislav Mikhailikov 2024-09-28 17:45:12 UTC
Found a possible fix here: https://github.com/intel/llvm/issues/1322?ysclid=m1mfyu1cmt334930047
Comment 17 Matt Turner gentoo-dev 2025-01-04 18:32:54 UTC
*** Bug 947399 has been marked as a duplicate of this bug. ***
Comment 18 Matt Turner gentoo-dev 2025-01-04 19:13:18 UTC
(In reply to Vladislav Mikhailikov from comment #16)
> Found a possible fix here:
> https://github.com/intel/llvm/issues/1322?ysclid=m1mfyu1cmt334930047

That doesn't make much sense to me because that's from 2020.
Comment 19 Matt Turner gentoo-dev 2025-01-04 19:15:48 UTC
(In reply to Enne Eziarc from comment #12)
> I've been wondering whether LLVM_TARGETS could be the cause of this, but
> I've had no success after many CPU-hours of experimenting.

LLVM_TARGETS=SPIRV seems plausible to me, given the undefined reference to `llvm::writeSpirv`. I haven't tried rebuilding clang/llvm/rust with it disabled to confirm. (I have it enabled, and I don't see this build failure)
Comment 20 Enne Eziarc 2025-01-04 20:26:09 UTC
I've given it another try and this time it built successfully:

```
=================================================================
                        Package Settings
=================================================================

media-libs/mesa-24.3.2::gentoo was built with the following:
USE="X llvm lm-sensors opencl (opengl) proprietary-codecs vaapi vdpau vulkan wayland zstd -d3d9 -debug -osmesa (-selinux) -test -unwind -valgrind -xa" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="18 -15 -16 -17" VIDEO_CARDS="radeonsi -d3d12 (-freedreno) -intel -lavapipe (-lima) -nouveau -nvk (-panfrost) -r300 -r600 -radeon (-v3d) (-vc4) -virgl (-vivante) -vmware -zink"

llvm-core/clang-18.1.8-r6::gentoo was built with the following:
USE="extra (pie) verify-sig -debug -doc (-ieee-long-double) -static-analyzer -test -xml" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AMDGPU AVR BPF SPIRV (X86) -AArch64 -ARC -ARM -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11 -python3_13"

llvm-core/llvm-18.1.8-r6::gentoo was built with the following:
USE="libffi ncurses verify-sig zstd -binutils-plugin -debug -debuginfod -doc -exegesis -libedit -test -xml -z3" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AMDGPU AVR BPF SPIRV (X86) -AArch64 -ARC -ARM -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa"

llvm-core/libclc-19.1.6::gentoo was built with the following:
USE="spirv verify-sig" ABI_X86="(64)" LLVM_SLOT="18 -17 -19" VIDEO_CARDS="radeonsi -nvidia -r600"
```

I can see rusticl in clinfo output now, and the GPU shows up if I force enable it with RUSTICL_ENABLE=radeonsi:0. It still doesn't work in any software I have installed but at least this compile problem seems to have gone away.
Comment 21 Attila Tóth 2025-01-05 09:39:57 UTC
Also builds for me now, although I haven't tested the functionality.
Comment 22 Pavel 2025-01-29 20:17:48 UTC
use flags libcxx and default-compiler-rt default-libcxx trigger this error
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-29 21:22:30 UTC
(In reply to Pavel from comment #22)
> use flags libcxx and default-compiler-rt default-libcxx trigger this error

libcxx breaks ABI, you're on your own there.