Created attachment 268083 [details] v1 ("git am")
Is it possible to reproduce the issue on 14.x? Tried USES+=llvm:21 - build without errors without patch.
(In reply to Vladimir Druzenko from comment #1) > Is it possible to reproduce the issue on 14.x? I use the following on -CURRENT: git remote add -t llvm-21-update -f dim "https://github.com/DimitryAndric/freebsd-src.git" git rebase --rebase-merges dim/llvm-21-update
(In reply to Vladimir Druzenko from comment #1) With USES+=llvm:21 it indeed uses clang21 to compile, but the system C++ library will still be libc++ 19, at least on 14.x. (The devel/llvm ports do not include the accompanying libc++ versions.)
(In reply to Dimitry Andric from comment #3) That's what I thought… Thanks for the clarification. Build fine on 14.x and 13.x amd64 with patch. (In reply to Evgenii Khramtsov from comment #2) Can you report this to the upstream? Or can you write a description and I'll create the issue myself? https://github.com/KhronosGroup/KTX-Software/issues
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=438a70797fc27940aa3276972591444707792551 commit 438a70797fc27940aa3276972591444707792551 Author: Evgenii Khramtsov <2khramtsov@gmail.com> AuthorDate: 2026-02-16 00:49:49 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-02-16 00:49:49 +0000 graphics/khronos-texture: Fix build with libc++ 21 [...] In file included from /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/src/os.cc:13: In file included from /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/os.h:11: /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/format.h:747:28: error: use of undeclared identifier 'malloc' 747 | T* p = static_cast<T*>(malloc(n * sizeof(T))); | ^~~~~~ /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/format.h:752:35: error: use of undeclared identifier 'free' 752 | void deallocate(T* p, size_t) { free(p); } | ^~~~ [...] While here udpate to USES+=compiler:c++14-lang - port uses -std=c++14. PR: 293197 MFH: 2026Q1 graphics/khronos-texture/Makefile | 2 +- .../files/patch-external_fmt_include_fmt_format.h (new) | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
A commit in branch 2026Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=cf42a29ebaba583b31de306fb77d5db6c13e100e commit cf42a29ebaba583b31de306fb77d5db6c13e100e Author: Evgenii Khramtsov <2khramtsov@gmail.com> AuthorDate: 2026-02-16 00:49:49 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-02-16 00:59:15 +0000 graphics/khronos-texture: Fix build with libc++ 21 [...] In file included from /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/src/os.cc:13: In file included from /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/os.h:11: /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/format.h:747:28: error: use of undeclared identifier 'malloc' 747 | T* p = static_cast<T*>(malloc(n * sizeof(T))); | ^~~~~~ /wrkdirs/usr/ports/graphics/khronos-texture/work/KTX-Software-4.4.2/external/fmt/include/fmt/format.h:752:35: error: use of undeclared identifier 'free' 752 | void deallocate(T* p, size_t) { free(p); } | ^~~~ [...] While here udpate to USES+=compiler:c++14-lang - port uses -std=c++14. PR: 293197 MFH: 2026Q1 (cherry picked from commit 438a70797fc27940aa3276972591444707792551) graphics/khronos-texture/Makefile | 2 +- .../files/patch-external_fmt_include_fmt_format.h (new) | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
Thanks.
(In reply to Vladimir Druzenko from comment #4) Upstream should be fmt which khronos-texture bundles (external/). I won't be available for at least two days for FOSS stuff, so if you are in hurry you know it's fmt.
fmt has https://github.com/fmtlib/fmt/commit/b77a7516251d upstream
(In reply to Evgenii Khramtsov from comment #9) The upstream fix for the original issue not only added a #include <cstdlib>, but also changed 'plain' malloc/free calls to std::malloc and std::free, which makes putting in alternate allocators difficult. But if you only add #include <cstdlib> (or #include <stdlib.h>, in this case it doesn't matter much), you won't have that problem.