#992862 libbsd-dev: Overlay mode breaks compilation of xorg server

Package:
xorg-server
Source:
xorg-server
Submitter:
Laurent Bigonville
Date:
2026-06-08 17:37:05 UTC
Severity:
important
Tags:
#992862#5
Date:
2021-08-24 12:05:16 UTC
From:
To:
Hello,

On kfreebsd, FTBFS because of the libbsd overlay:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../dix -I../include -I../../../../include -Wdate-time -D_FORTIFY_SOURCE=2 -DPRE_RELEASE=0 -DLIBBSD_OVERLAY -isystem /usr/include/bsd -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fno-strict-aliasing -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/X11/dri -I../../../../include -I../include -I../../../../Xext -I../../../../composite -I../../../../damageext -I../../../../xfixes -I../../../../Xi -I../../../../mi -I../../../../miext/sync -I../../../../miext/shadow -I../../../../miext/damage -I../../../../render -I../../../../randr -I../../../../fb -I../../../../dbe -I../../../../present -fvisibility=hidden -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -c ../../../../dix/colormap.c  -fPIC -DPIC -o .libs/colormap.o
In file included from ../../../../include/os.h:58,
                 from ../../../../include/misc.h:117,
                 from ../../../../dix/atom.c:55:
/usr/include/bsd/stdlib.h:30:25: error: no include path in which to search for stdlib.h
   30 | #include_next <stdlib.h>
      |                         ^
In file included from ../../../../include/os.h:61,
                 from ../../../../include/misc.h:117,
                 from ../../../../dix/atom.c:55:
/usr/include/bsd/string.h:28:25: error: no include path in which to search for string.h
   28 | #include_next <string.h>
      |                         ^
In file included from ../../../../include/os.h:58,
                 from ../../../../include/misc.h:117,
                 from ../../../../dix/colormap.c:56:
/usr/include/bsd/stdlib.h:30:25: error: no include path in which to search for stdlib.h
   30 | #include_next <stdlib.h>
      |                         ^
In file included from ../../../../include/os.h:61,
                 from ../../../../include/misc.h:117,
                 from ../../../../dix/colormap.c:56:
/usr/include/bsd/string.h:28:25: error: no include path in which to search for string.h
   28 | #include_next <string.h>
      |                         ^

https://buildd.debian.org/status/fetch.php?pkg=xorg-server&arch=kfreebsd-amd64&ver=2%3A1.20.9-2&stamp=1606590993&raw=0

Removing CFLAGS added by the pkg-config libbsd-overlay file, fixes the
build but getpeereid() is not detected or used anymore

I can reproduce this with a manually built version of 0.11.3-1 too

Kind regards,
Laurent Bigonville

#992862#14
Date:
2022-02-15 21:09:22 UTC
From:
To:
Hi!

This looks like a regression from X.Org upstream. The attached two
patches makes this build again on my GNU/kFreeBSD system. In any case,
either the libbsd overlay should be used, or explicit support for
libbsd should be added upstream, combining both breaks the build.

Thanks,
Guillem