Skip to content

build fails on OmniOS using Clang 20 due to missing types #1548

@infrastation

Description

@infrastation
$ uname -a
SunOS omnios-r151054 5.11 omnios-r151054-180b86b9dd i86pc i386 i86pc

# pkg install ooce/developer/clang-19 ooce/developer/clang-20

$ clang-19 --version
OmniOS/151054 clang version 19.1.7
Target: x86_64-pc-solaris2.11
Thread model: posix
InstalledDir: /opt/ooce/llvm-19/bin
Configuration file: /opt/ooce/llvm-19/bin/x86_64-pc-solaris2.11.cfg

$ CC=clang-19 ./configure && make -s
(works as expected)

$ clang-20 --version
OmniOS/151054 clang version 20.1.7
Target: x86_64-pc-solaris2.11
Thread model: posix
InstalledDir: /opt/ooce/llvm-20/bin
Configuration file: /opt/ooce/llvm-20/bin/x86_64-pc-solaris2.11.cfg

$ CC=clang-20 ./configure && make -s
[...]
In file included from fad-getad.c:49:
In file included from ./pcap-int.h:41:
In file included from ./pcap/pcap.h:130:
./pcap/bpf.h:93:9: error: unknown type name 'u_int'
   93 | typedef u_int bpf_u_int32;
      |         ^
./pcap/bpf.h:112:2: error: unknown type name 'u_int'
  112 |         u_int bf_len;
      |         ^
./pcap/bpf.h:240:2: error: unknown type name 'u_short'; did you mean 'short'?
  240 |         u_short code;
      |         ^~~~~~~
      |         short
./pcap/bpf.h:241:2: error: unknown type name 'u_char'; did you mean 'char'?
  241 |         u_char  jt;
      |         ^~~~~~
      |         char

(and so on)

It looks like with version 20 the system header is no longer included:

/usr/include/sys/types.h:675:typedef unsigned char      u_char;
/usr/include/sys/types.h:676:typedef unsigned short      u_short;
/usr/include/sys/types.h:677:typedef unsigned int       u_int;

The problem is not visible in the CI, which is currently using Clang 19. Clang 20 has been working as expected for a while on linux-aarch64. Clang 20 also works on Haiku.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions