[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1011952: mesa: FTBFS on kfreebsd



Source: mesa
Version: 22.1.0~rc5-1
Severity: important
Tags: patch ftbfs
Justification: fails to build from source (but built successfully in the past)
Forwarded: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4081

Hello,

mesa currently FTBFS on kfreebsd

The attached patch seems to fix this

The patch has been propsed upstream

Could you please apply that patch?

Kind regards,
Laurent Bigonville


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.17.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), LANGUAGE=fr_BE:fr
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: SELinux: enabled - Mode: Permissive - Policy name: refpolicy
diff -u mesa-22.1.0/debian/patches/series mesa-22.1.0/debian/patches/series
--- mesa-22.1.0/debian/patches/series
+++ mesa-22.1.0/debian/patches/series
@@ -2,3 +2,4 @@
 path_max.diff
 src_glx_dri_common.h.diff
 revert-enabling-tlsdesc-support.diff
+fix_ftbfs_kfreebsd.patch
diff -u mesa-22.1.0/debian/rules mesa-22.1.0/debian/rules
--- mesa-22.1.0/debian/rules
+++ mesa-22.1.0/debian/rules
@@ -56,7 +56,6 @@
 
 	confflags_DIRECT_RENDERING = -Dglx-direct=true
 	confflags_GBM = -Dgbm=enabled
-	confflags_GALLIUM += -Dgallium-extra-hud=true
 	confflags_GALLIUM += -Dgallium-vdpau=enabled
 	confflags_GALLIUM += -Dlmsensors=enabled
 
@@ -68,6 +67,7 @@
 
   ifeq ($(DEB_HOST_ARCH_OS), linux)
 	confflags_DRI3 = -Ddri3=enabled
+	confflags_GALLIUM += -Dgallium-extra-hud=true
 	# Gallium drivers which require kernel support, not yet ported to non-Linux
 	GALLIUM_DRIVERS += nouveau virgl
 
only in patch2:
unchanged:
--- mesa-22.1.0.orig/debian/patches/fix_ftbfs_kfreebsd.patch
+++ mesa-22.1.0/debian/patches/fix_ftbfs_kfreebsd.patch
@@ -0,0 +1,53 @@
+From 809fc7ef474a6010f2eafc853d8d1322f97a539c Mon Sep 17 00:00:00 2001
+From: Laurent Bigonville <bigon@bigon.be>
+Date: Thu, 17 Feb 2022 14:49:27 +0100
+Subject: [PATCH] Try to fix FTBFS on kfreebsd architecture
+
+Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4081
+---
+ include/drm-uapi/sync_file.h | 1 +
+ src/util/u_qsort.h           | 2 +-
+ src/util/u_thread.h          | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/include/drm-uapi/sync_file.h b/include/drm-uapi/sync_file.h
+index 11d86db53e4..7ede34e12de 100644
+--- a/include/drm-uapi/sync_file.h
++++ b/include/drm-uapi/sync_file.h
+@@ -19,6 +19,7 @@
+ 
+ #else /* One of the BSDs */
+ 
++#include <stdint.h>
+ #include <sys/types.h>
+ #include <sys/ioccom.h>
+ 
+diff --git a/src/util/u_qsort.h b/src/util/u_qsort.h
+index 34fff94dba4..ac3dfebaa6b 100644
+--- a/src/util/u_qsort.h
++++ b/src/util/u_qsort.h
+@@ -57,7 +57,7 @@ util_qsort_r(void *base, size_t nmemb, size_t size,
+              void *arg)
+ {
+ #if HAVE_QSORT_R
+-#  if DETECT_OS_APPLE || DETECT_OS_BSD
++#  if (DETECT_OS_APPLE || DETECT_OS_BSD) && ! defined(__GLIBC__)
+    /* BSD/macOS qsort_r takes "arg" before the comparison function and it
+     * pass the "arg" before the elements.
+     */
+diff --git a/src/util/u_thread.h b/src/util/u_thread.h
+index d06ff6beddb..70c02bf938c 100644
+--- a/src/util/u_thread.h
++++ b/src/util/u_thread.h
+@@ -125,7 +125,7 @@ static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
+ static inline void u_thread_setname( const char *name )
+ {
+ #if defined(HAVE_PTHREAD)
+-#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS
++#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || defined(__GLIBC__)
+    int ret = pthread_setname_np(pthread_self(), name);
+    if (ret == ERANGE) {
+       char buf[16];
+-- 
+GitLab
+

Reply to: