The LLVM ports do not include various standard C/C99 headers because of this patch: <https://cgit.freebsd.org/ports/tree/devel/llvm17/files/patch-clang_lib_Headers_CMakeLists.txt> My specific problem is that this prevents Wine from using LLVM/clang from ports as a PE cross-compiler. In this case Wine uses clang in the 'x86_64-windows' mode, configure does a check in this mode and tries to build a sample file which includes <stddef.h>, and this fails. LLVM/clang packages on other OSes (Gentoo Linux, macOS Homebrew) do include these files. And more generally, anyone trying to use ports LLVM/clang to target a freestanding/bare-metal environment would not be able to use any of these standard header files. E.g. for a very simple test.c: #include <stdint.h> uint64_t hi(void) { return 1; } and build with: $ /usr/local/bin/clang --target=arm-none-eabi -nostdlib -o test.o test.c
We either need to patch FreeBSD's include files so that it can build with the llvm ones installed or patch the llvm ones to honor FreeBSD's guard macros. I'm not sure which is the best approach, but until that's resolved we're stuck in this situation.