With libc++ 21 cad/kicad fails to build, with errors similar to: /wrkdirs/usr/ports/cad/kicad/work/kicad-9.0.8/thirdparty/fmt/include/fmt/format.h:750:35: error: use of undeclared identifier 'free' 750 | void deallocate(T* p, size_t) { free(p); } | ^~~~ /wrkdirs/usr/ports/cad/kicad/work/kicad-9.0.8/thirdparty/fmt/include/fmt/format.h:810:46: note: in instantiation of member function 'fmt::detail::allocator<int>::deallocate' requested here 810 | if (old_data != self.store_) self.alloc_.deallocate(old_data, old_capacity); | ^ This is because malloc and free are defined in <cstdlib>, and format.h does not explicitly include it. (Before libc++ 21, the fmt library was "lucky" that <cstdlib> was included transitively, but this is no longer the case.)
Created attachment 268961 [details] cad/kicad: fix build with libc++ 21
I just updated kicad to version 10 a few hours ago (ports 04b7169b76dde7540b07ba13089bf3f7608e6581), and that comes with fmt 12.1.0 which looks like it doesn't need this anymore https://gitlab.com/kicad/code/kicad/-/blob/10.0/thirdparty/fmt/include/fmt/format.h?ref_type=heads#L50 That leaves quarterly - how urgent is this? The quarter is almost over...
Oh it's not terribly urgent, I had all the patches for the llvm-21-update branch marked with MFH: 2026Q1 out of habit. I think I updated my ports tree today, and it still had kicad-9.0.8_1,2, but I will probably just have missed your commit. :)