Bug 290809 - graphics/mesa-dri does not build with llvm20
Summary: graphics/mesa-dri does not build with llvm20
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-05 09:31 UTC by Xavier Humbert
Modified: 2026-05-31 14:52 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments
grapics/mesa-dri full build log (15.09 KB, application/x-xz)
2025-11-05 09:33 UTC, Xavier Humbert
no flags Details
Upstream commit 14ebecd78711804bc60f56cc53632bfab9d375df (1.02 KB, patch)
2025-12-03 22:14 UTC, Dimitry Andric
no flags Details | Diff
graphics/mesa-dri: fix clc compilation error with llvm >= 20 (2.37 KB, patch)
2026-01-17 16:54 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Humbert 2025-11-05 09:31:50 UTC
Now that I have patched and installed devel/libclc for llvm20 (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290260), graphics/mesa-dri fails to build. Attached is the full build log. It resumes to this :

../src/compiler/clc/clc_helpers.cpp:844:7: error: no matching member function for call to 'createDiagnostics'
Comment 1 Xavier Humbert 2025-11-05 09:33:25 UTC
Created attachment 265177 [details]
grapics/mesa-dri full build log
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2025-12-03 22:14:03 UTC
Created attachment 265809 [details]
Upstream commit 14ebecd78711804bc60f56cc53632bfab9d375df

I would try to import a patch from upstream, e.g.:

https://gitlab.freedesktop.org/mesa/mesa/-/commit/14ebecd78711804bc60f56cc53632bfab9d375df

(Also attached)
Comment 3 Xavier Humbert 2026-01-17 15:59:03 UTC
(In reply to Dimitry Andric from comment #2)
Still the same error with pull from head today
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2026-01-17 16:54:31 UTC
Created attachment 267242 [details]
graphics/mesa-dri: fix clc compilation error with llvm >= 20

Please try this patch. Has devel/libclc been updated in the mean time?
Comment 5 Mikhail Teterin freebsd_committer freebsd_triage 2026-01-31 17:13:17 UTC
The Bug 290874, which seems to duplicate this one, lists several upstream patches.

Having applied the diff proposed there -- and fixed the new patchs' checksums locally -- I was able to build mesa-dri 24.1.7 using llvm-20.1.8 here, on 15-STABLE.

That said, the latest upstream version of mesa-dri is 25.3.4 -- is the upgrade of the port almost ready?
Comment 6 Dimitry Andric freebsd_committer freebsd_triage 2026-01-31 18:45:12 UTC
(In reply to Mikhail Teterin from comment #5)
If the new version includes those patches, then this bug and bug 290874 are no longer necessary.

On the other hand, new versions of mesa-dri tend to take a while, probably because lots of other ports depend on it. So this bug is at least a "quick fix". :)
Comment 7 Mikhail Teterin freebsd_committer freebsd_triage 2026-02-01 14:42:00 UTC
(In reply to Dimitry Andric from comment #6)
> So this bug is at least a "quick fix". :)

I prefer the diff proposed in bug 290874, because it applies additional fixes from Mesa's Github.

But, whichever is picked, it should be done soon -- llvm21 is stable, llvm20 is even more so. Holding people back on llvm19 for the sake of Mesa is not good...
Comment 8 Dimitry Andric freebsd_committer freebsd_triage 2026-02-03 21:57:11 UTC
(In reply to Mikhail Teterin from comment #7)
My fix is only to get it to compile with clang 21 as /usr/bin/cc in the base system, the other fixes in bug 290874 are for building against the LLVM 21 API.

If the maintainer for mesa-dri is indeed x11@ then I would like an update from that group:

* is a new version of mesa-dri already being imported somewhere? It looks like upstream is already at 25.3.4, but going to a new major version is probable to break some things
* can we import the fixes from bug 290874 wholesale?
Comment 9 Dimitry Andric freebsd_committer freebsd_triage 2026-02-10 19:31:37 UTC
(In reply to Dimitry Andric from comment #8)
It looks like bug 290874 is missing the patch for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30980, so I don't think it is complete. For now, I will just commit my single patch, since that is the least intrusive.
Comment 10 Mikhail Teterin freebsd_committer freebsd_triage 2026-02-24 14:01:30 UTC
(In reply to Dimitry Andric from comment #9)
> For now, I will just commit my single patch, since that is the least intrusive.

Build of mesa-dri 24.1.7 still fails for me here, on 15-stable with llvm21:

T_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LIBUDEV '-DMESA_LLVM_VERSION_STRING="21.1.8"' -DLLVM_IS_SHARED=1 -DLLVM_AVAILABLE=1 -DDRAW_LLVM_AVAILABLE=1 -DUSE_LIBELF -DTHREAD_SANITIZER=0 -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRI3_EXPLICIT_SYNC -DHAVE_DRISW_KMS -Werror=return-type -Werror=empty-body -Wmisleading-indentation -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -Qunused-arguments -Wno-unknown-pragmas -Wno-microsoft-enum-value -Werror=format -Wformat-security -ffunction-sections -fdata-sections -Wno-unused-variable -Wno-unused-but-set-variable -O2 -pipe -march=ivybridge -fstack-protector-strong -fno-strict-aliasing -march=ivybridge -fPIC -pthread -isystem/opt/llvm21/include -DEXPERIMENTAL_KEY_INSTRUCTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MQ src/amd/llvm/libamd_common_llvm.a.p/ac_llvm_helper.cpp.o -MF src/amd/llvm/libamd_common_llvm.a.p/ac_llvm_helper.cpp.o.d -o src/amd/llvm/libamd_common_llvm.a.p/ac_llvm_helper.cpp.o -c ../src/amd/llvm/ac_llvm_helper.cpp
../src/amd/llvm/ac_llvm_helper.cpp:103:36: error: no viable conversion from 'const std::string' (aka 'const basic_string<char>') to 'Triple'
  103 |    unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/llvm21/include/llvm/TargetParser/Triple.h:47:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const std::string' (aka 'const basic_string<char>') to 'const Triple &' for 1st argument
   47 | class Triple {
      |       ^~~~~~
/opt/llvm21/include/llvm/TargetParser/Triple.h:47:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::string' (aka 'const basic_string<char>') to 'Triple &&' for 1st argument
   47 | class Triple {
      |       ^~~~~~
/opt/llvm21/include/llvm/TargetParser/Triple.h:354:21: note: explicit constructor is not a candidate
  354 |   LLVM_ABI explicit Triple(std::string &&Str);
      |                     ^
/opt/llvm21/include/llvm/TargetParser/Triple.h:355:12: note: explicit constructor is not a candidate
  355 |   explicit Triple(StringRef Str) : Triple(Str.str()) {}
      |            ^
/opt/llvm21/include/llvm/TargetParser/Triple.h:356:12: note: explicit constructor is not a candidate
  356 |   explicit Triple(const char *Str) : Triple(std::string(Str)) {}
      |            ^
/opt/llvm21/include/llvm/TargetParser/Triple.h:357:12: note: explicit constructor is not a candidate
  357 |   explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}
      |            ^
/opt/llvm21/include/llvm/TargetParser/Triple.h:358:21: note: explicit constructor is not a candidate
  358 |   LLVM_ABI explicit Triple(const Twine &Str);
      |                     ^
/usr/include/c++/v1/string:1215:55: note: candidate function
 1215 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
      |                                                       ^
/opt/llvm21/include/llvm/IR/Module.h:324:31: note: passing argument to parameter 'T' here
  324 |   void setTargetTriple(Triple T) { TargetTriple = std::move(T); }
      |                               ^
1 error generated.
ninja: build stopped: subcommand failed.
Comment 11 Mikhail Teterin freebsd_committer freebsd_triage 2026-02-24 14:13:35 UTC
(In reply to Dimitry Andric from comment #9)
> It looks like bug 290874 is missing the patch for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30980

I don't know the significance of the 30980 -- maybe, you can add it by hand? But I can confirm, that the current patch from Bug 290874 does fix the build for me.
Comment 12 Xavier Humbert 2026-03-27 15:21:09 UTC
(In reply to Mikhail Teterin from comment #10)

Fails also with 14.3-STABLE, with DEFAULT_VERSIONS+=llvm=20 in make.conf 

[root@numenor mesa-dri]# MAKE_JOBS_UNSAFE=yes make all
===>  Building for mesa-dri-24.1.7_11
[  0% 1/1920] /usr/ports/graphics/mesa-dri/work/.bin/python3 ../bin/git_sha1_gen.py --output src/git_sha1.h
[  0% 2/1915] c++ -Isrc/compiler/clc/liblibmesaclc.a.p -Isrc/compiler/clc -I../src/compiler/clc -Iinclude -I../include -Isrc -I../src -Isrc/compiler/spirv -I../src/compiler/spirv -Isrc/compiler/nir -I../src/compiler/nir -Isrc/compiler -I../src/compiler -I/usr/local/include -I/usr/local/llvm20/include -fdiagnostics-color=never -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 '-DPACKAGE_VERSION="24.1.7"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_CROCUS -DHAVE_I915 -DHAVE_IRIS -DHAVE_R300 -DHAVE_R600 -DHAVE_RADEONSI -DHAVE_SVGA -DHAVE_SWRAST -DHAVE_ZINK -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DVIDEO_CODEC_AV1DEC=1 -DVIDEO_CODEC_AV1ENC=1 -DVIDEO_CODEC_VP9DEC=1 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DGLAPI_EXPORT_PROTO_ENTRY_POINTS=0 -DALLOW_KCMP -DETIME=ETIMEDOUT -DMESA_DEBUG=0 -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY -DHAVE_FMEMOPEN -D_GNU_SOURCE -DUSE_SSE41 -DHAVE___BUILTIN_IA32_CLFLUSHOPT -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_S -DHAVE_POSIX_FALLOCATE -DHAVE_SECURE_GETENV -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DSUPPORT_INTEL_INTEGRATED_GPUS -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LIBUDEV '-DMESA_LLVM_VERSION_STRING="20.1.8"' -DLLVM_IS_SHARED=1 -DLLVM_AVAILABLE=1 -DDRAW_LLVM_AVAILABLE=1 -DUSE_LIBELF -DTHREAD_SANITIZER=0 -DWL_HIDE_DEPRECATED -DHAVE_WL_DISPATCH_QUEUE_TIMEOUT -DHAVE_WL_CREATE_QUEUE_WITH_NAME -DXCB_KEYSYMS_AVAILABLE -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRI3_EXPLICIT_SYNC -DHAVE_DRISW_KMS -Werror=return-type -Werror=empty-body -Wmisleading-indentation -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -Qunused-arguments -Wno-unknown-pragmas -Wno-microsoft-enum-value -Werror=format -Wformat-security -ffunction-sections -fdata-sections -Wno-unused-variable -Wno-unused-but-set-variable -O2 -pipe -g -march=core2 -fstack-protector-strong -fno-strict-aliasing -g -fPIC -pthread -isystem/usr/local/llvm20/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DLLVM_LIB_DIR="/usr/local/llvm20/lib"' '-DDYNAMIC_LIBCLC_PATH="/usr/local/llvm20/share/clc/"' -DHAS_SPIRV_LINK_LLVM_WORKAROUND=1 -MD -MQ src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o -MF src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o.d -o src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o -c ../src/compiler/clc/clc_helpers.cpp
FAILED: [code=1] src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o 
c++ -Isrc/compiler/clc/liblibmesaclc.a.p -Isrc/compiler/clc -I../src/compiler/clc -Iinclude -I../include -Isrc -I../src -Isrc/compiler/spirv -I../src/compiler/spirv -Isrc/compiler/nir -I../src/compiler/nir -Isrc/compiler -I../src/compiler -I/usr/local/include -I/usr/local/llvm20/include -fdiagnostics-color=never -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 '-DPACKAGE_VERSION="24.1.7"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_CROCUS -DHAVE_I915 -DHAVE_IRIS -DHAVE_R300 -DHAVE_R600 -DHAVE_RADEONSI -DHAVE_SVGA -DHAVE_SWRAST -DHAVE_ZINK -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DVIDEO_CODEC_AV1DEC=1 -DVIDEO_CODEC_AV1ENC=1 -DVIDEO_CODEC_VP9DEC=1 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DGLAPI_EXPORT_PROTO_ENTRY_POINTS=0 -DALLOW_KCMP -DETIME=ETIMEDOUT -DMESA_DEBUG=0 -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY -DHAVE_FMEMOPEN -D_GNU_SOURCE -DUSE_SSE41 -DHAVE___BUILTIN_IA32_CLFLUSHOPT -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_S -DHAVE_POSIX_FALLOCATE -DHAVE_SECURE_GETENV -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DSUPPORT_INTEL_INTEGRATED_GPUS -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LIBUDEV '-DMESA_LLVM_VERSION_STRING="20.1.8"' -DLLVM_IS_SHARED=1 -DLLVM_AVAILABLE=1 -DDRAW_LLVM_AVAILABLE=1 -DUSE_LIBELF -DTHREAD_SANITIZER=0 -DWL_HIDE_DEPRECATED -DHAVE_WL_DISPATCH_QUEUE_TIMEOUT -DHAVE_WL_CREATE_QUEUE_WITH_NAME -DXCB_KEYSYMS_AVAILABLE -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRI3_EXPLICIT_SYNC -DHAVE_DRISW_KMS -Werror=return-type -Werror=empty-body -Wmisleading-indentation -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -Qunused-arguments -Wno-unknown-pragmas -Wno-microsoft-enum-value -Werror=format -Wformat-security -ffunction-sections -fdata-sections -Wno-unused-variable -Wno-unused-but-set-variable -O2 -pipe -g -march=core2 -fstack-protector-strong -fno-strict-aliasing -g -fPIC -pthread -isystem/usr/local/llvm20/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DLLVM_LIB_DIR="/usr/local/llvm20/lib"' '-DDYNAMIC_LIBCLC_PATH="/usr/local/llvm20/share/clc/"' -DHAS_SPIRV_LINK_LLVM_WORKAROUND=1 -MD -MQ src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o -MF src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o.d -o src/compiler/clc/liblibmesaclc.a.p/clc_helpers.cpp.o -c ../src/compiler/clc/clc_helpers.cpp
../src/compiler/clc/clc_helpers.cpp:844:7: error: no matching member function for call to 'createDiagnostics'
  844 |    c->createDiagnostics(new clang::TextDiagnosticPrinter(
      |    ~~~^~~~~~~~~~~~~~~~~
/usr/local/llvm20/include/clang/Frontend/CompilerInstance.h:687:8: note: candidate function not viable: no known conversion from 'clang::TextDiagnosticPrinter *' to 'llvm::vfs::FileSystem &' for 1st argument
  687 |   void createDiagnostics(llvm::vfs::FileSystem &VFS,
      |        ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/llvm20/include/clang/Frontend/CompilerInstance.h:710:3: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
  710 |   createDiagnostics(llvm::vfs::FileSystem &VFS, DiagnosticOptions *Opts,
      |   ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711 |                     DiagnosticConsumer *Client = nullptr,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  712 |                     bool ShouldOwnClient = true,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  713 |                     const CodeGenOptions *CodeGenOpts = nullptr);
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/compiler/clc/clc_helpers.cpp:892:66: error: too many arguments to function call, expected single argument 'BinaryPath', have 2 arguments
  892 |       fs::path(Driver::GetResourcesPath(std::string(clang_path), CLANG_RESOURCE_DIR)) / "include";
      |                ~~~~~~~~~~~~~~~~~~~~~~~~                          ^~~~~~~~~~~~~~~~~~
/usr/local/llvm20/include/clang/Config/config.h:39:28: note: expanded from macro 'CLANG_RESOURCE_DIR'
   39 | #define CLANG_RESOURCE_DIR ""
      |                            ^~
/usr/local/llvm20/include/clang/Driver/Driver.h:410:22: note: 'GetResourcesPath' declared here
  410 |   static std::string GetResourcesPath(StringRef BinaryPath);
      |                      ^                ~~~~~~~~~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped making "/usr/ports/graphics/mesa-dri/work/.stage_done.mesa-dri._usr_local" in /usr/ports/graphics/mesa-dri
*** Error code 1

Stop.
make: stopped making "all" in /usr/ports/graphics/mesa-dri
Comment 13 Dimitry Andric freebsd_committer freebsd_triage 2026-03-28 19:53:24 UTC
(In reply to Xavier Humbert from comment #12)
If I try to build that, it immediately dies with devel/libclc having no llvm20 flavor. How are you building it?
Comment 14 Xavier Humbert 2026-03-29 07:03:29 UTC
(In reply to Dimitry Andric from comment #13)
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290260
Comment 15 Anton Saietskii 2026-05-18 10:40:52 UTC
(In reply to Dimitry Andric from comment #4)

It doesn't apply for me unfortunately:
> fetch -o /tmp/patch.txt 'https://bz-attachments.freebsd.org/attachment.cgi?id=267242' && git am /tmp/patch.txt
fetch: https://bz-attachments.freebsd.org/attachment.cgi?id=267242: size of remote file is not known
/tmp/patch.txt                                        2422  B   10 MBps    00s
Patch format detection failed.
Comment 16 commit-hook freebsd_committer freebsd_triage 2026-05-31 14:49:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e45b1bd3027b31845938ab6c7a5adc28c87d7ece

commit e45b1bd3027b31845938ab6c7a5adc28c87d7ece
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-05-31 14:48:32 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-05-31 14:49:03 +0000

    graphics/mesa-dri: fix builds against llvm 20 and 21

    Add several upstream patches, as patch-llvm-20-* and patch-llvm-21-*, to
    make mesa build against llvm 20 and 21. Whenever mesa gets updated to a
    new version which includes those changes, the patches can easily be
    removed.

    PR:             290809, 290874
    MFH:            2026Q2

 graphics/mesa-dri/files/patch-llvm20-1 (new) | 44 +++++++++++++++
 graphics/mesa-dri/files/patch-llvm20-2 (new) | 82 ++++++++++++++++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-1 (new) | 36 ++++++++++++
 graphics/mesa-dri/files/patch-llvm21-2 (new) | 42 ++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-3 (new) | 46 ++++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-4 (new) | 49 +++++++++++++++++
 6 files changed, 299 insertions(+)
Comment 17 commit-hook freebsd_committer freebsd_triage 2026-05-31 14:51:00 UTC
A commit in branch 2026Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8d45f0429eb40aeb8e14afc3649941b195bb9cfa

commit 8d45f0429eb40aeb8e14afc3649941b195bb9cfa
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-05-31 14:48:32 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-05-31 14:50:16 +0000

    graphics/mesa-dri: fix builds against llvm 20 and 21

    Add several upstream patches, as patch-llvm-20-* and patch-llvm-21-*, to
    make mesa build against llvm 20 and 21. Whenever mesa gets updated to a
    new version which includes those changes, the patches can easily be
    removed.

    PR:             290809, 290874
    MFH:            2026Q2
    (cherry picked from commit e45b1bd3027b31845938ab6c7a5adc28c87d7ece)

 graphics/mesa-dri/files/patch-llvm20-1 (new) | 44 +++++++++++++++
 graphics/mesa-dri/files/patch-llvm20-2 (new) | 82 ++++++++++++++++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-1 (new) | 36 ++++++++++++
 graphics/mesa-dri/files/patch-llvm21-2 (new) | 42 ++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-3 (new) | 46 ++++++++++++++++
 graphics/mesa-dri/files/patch-llvm21-4 (new) | 49 +++++++++++++++++
 6 files changed, 299 insertions(+)