[Bug 274542] devel/llvm: C99 include files are not included

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 Oct 2023 17:31:41 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274542

            Bug ID: 274542
           Summary: devel/llvm: C99 include files are not included
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: brooks@FreeBSD.org
          Reporter: mrpippy@gmail.com
          Assignee: brooks@FreeBSD.org
             Flags: maintainer-feedback?(brooks@FreeBSD.org)

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

-- 
You are receiving this mail because:
You are the assignee for the bug.