Skip to content

build: fix build and provide compat for OpenBSD

Sebastien Marie requested to merge semarie/wayland:openbsd into main
  • wayland-egl-abi-check: try to use llvm-nm first instead of BSD nm (incompatible options)
  • #define _BSD_SOURCE to provide some C definition even with _POSIX_C_SOURCE=200809L (SOCK_CLOEXEC become available)
  • provide compat layer for waitid(2) (unavailable on OpenBSD)
  • epoll(7) is provided by a userspace wrapper around kqueue(2) as FreeBSD
  • when using SO_PEERCRED, the struct to use is struct sockpeercred instead of struct ucred on OpenBSD
  • provide a compatibility layer for count_open_fds() using sysctl(2) as FreeBSD

With it, I am able to build and run tests suite on OpenBSD:

$ ninja -C build/ test
ninja: Entering directory `build/'
[0/1] Running all tests.
 1/23 cpp-compile-test                      OK              0.01s
 2/23 wayland-egl symbols check             OK              0.10s
 3/23 array-test                            OK              0.02s
 4/23 client-test                           OK              0.01s
 5/23 scanner-test                          OK              0.21s
 6/23 display-test                          OK              0.86s
 7/23 event-loop-test                       OK              0.22s
 8/23 fixed-test                            OK              0.01s
 9/23 interface-test                        OK              0.01s
10/23 list-test                             OK              0.01s
11/23 map-test                              OK              0.01s
12/23 connection-test                       OK              1.23s
13/23 socket-test                           OK              0.05s
14/23 queue-test                            OK              0.02s
15/23 signal-test                           OK              0.01s
16/23 newsignal-test                        OK              0.01s
17/23 resources-test                        OK              0.01s
18/23 message-test                          OK              0.01s
19/23 compositor-introspection-test         OK              0.01s
20/23 protocol-logger-test                  OK              0.01s
21/23 headers-test                          OK              0.01s
22/23 os-wrappers-test                      OK              0.02s
23/23 sanity-test                           OK              4.52s

Ok:                 23  
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Merge request reports