Control: reassign -1 xorg-server
Control: affects -1 - xorg-server
Control: tags -1 patch upstream

Hi!

On Tue, 2021-08-24 at 14:05:16 +0200, Laurent Bigonville wrote:
> Package: libbsd-dev
> Version: 0.10.0-1
> Severity: important

> 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

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
---
 include/os.h |    7 +------
 os/auth.c    |    4 +---
 2 files changed, 2 insertions(+), 9 deletions(-)

--- a/include/os.h
+++ b/include/os.h
@@ -50,16 +50,11 @@ SOFTWARE.
 #include "misc.h"
 #include <stdarg.h>
 #include <stdint.h>
+#include <stdlib.h>       /* for reallocarray */
 #include <string.h>
 #ifdef MONOTONIC_CLOCK
 #include <time.h>
 #endif
-#if defined(HAVE_LIBBSD) && defined(HAVE_REALLOCARRAY)
-#include <bsd/stdlib.h>       /* for reallocarray */
-#endif
-#if defined(HAVE_LIBBSD) && defined(HAVE_STRLCPY)
-#include <bsd/string.h>       /* for strlcpy, strlcat */
-#endif
 
 #define SCREEN_SAVER_ON   0
 #define SCREEN_SAVER_OFF  1
--- a/os/auth.c
+++ b/os/auth.c
@@ -46,9 +46,7 @@ from The Open Group.
 #ifdef WIN32
 #include    <X11/Xw32defs.h>
 #endif
-#ifdef HAVE_LIBBSD
-#include   <bsd/stdlib.h>       /* for arc4random_buf() */
-#endif
+#include   <stdlib.h>       /* for arc4random_buf() */
 
 struct protocol {
     unsigned short name_length;
---
 glamor/glamor_egl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -295,7 +295,7 @@ glamor_make_pixmap_exportable(PixmapPtr
         format = GBM_FORMAT_ARGB1555;
         break;
     case 8:
-        format = GBM_FORMAT_R8;
+        format = GBM_FORMAT_C8;
         break;
     default:
         xf86DrvMsg(scrn->scrnIndex, X_ERROR,

Reply via email to