* [scarthgap][PATCH 1/2] mesa: fix build on host with glibc-2.43
@ 2026-04-10 6:42 martin.jansa
2026-04-10 6:42 ` [scarthgap][PATCH 2/2] virglrenderer: Fix build with glibc 2.43+ martin.jansa
0 siblings, 1 reply; 2+ messages in thread
From: martin.jansa @ 2026-04-10 6:42 UTC (permalink / raw)
To: openembedded-core; +Cc: Martin Jansa
From: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
.../0001-c11-threads-fix-build-on-c23.patch | 56 +++++++++++++++++++
meta/recipes-graphics/mesa/mesa.inc | 1 +
2 files changed, 57 insertions(+)
create mode 100644 meta/recipes-graphics/mesa/files/0001-c11-threads-fix-build-on-c23.patch
diff --git a/meta/recipes-graphics/mesa/files/0001-c11-threads-fix-build-on-c23.patch b/meta/recipes-graphics/mesa/files/0001-c11-threads-fix-build-on-c23.patch
new file mode 100644
index 0000000000..f4de5e61a9
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-c11-threads-fix-build-on-c23.patch
@@ -0,0 +1,56 @@
+From 3f007af78283aea2e8c1a3addff7aeae862d8b28 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@redhat.com>
+Date: Fri, 7 Nov 2025 13:14:56 +1000
+Subject: [PATCH] c11/threads: fix build on c23
+
+C23/glibc is now including once_init in stdlib.h
+
+https://patchwork.sourceware.org/project/glibc/patch/78061085-f04a-0c45-107b-5a8a15521083@redhat.com/#213088
+
+Just fix up our use of it.
+
+Cc: mesa-stable
+Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38298>
+
+Upstream-Status: Backport [v26.0.0 179e744f7577d98df7c79d7324c22acfb32a0154]
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+ src/c11/impl/threads_posix.c | 3 ++-
+ src/c11/threads.h | 2 ++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/c11/impl/threads_posix.c b/src/c11/impl/threads_posix.c
+index 2540e3e0c49..f75774fc51d 100644
+--- a/src/c11/impl/threads_posix.c
++++ b/src/c11/impl/threads_posix.c
+@@ -70,12 +70,13 @@ impl_thrd_routine(void *p)
+
+ /*--------------- 7.25.2 Initialization functions ---------------*/
+ // 7.25.2.1
++#ifndef __once_flag_defined
+ void
+ call_once(once_flag *flag, void (*func)(void))
+ {
+ pthread_once(flag, func);
+ }
+-
++#endif
+
+ /*------------- 7.25.3 Condition variable functions -------------*/
+ // 7.25.3.1
+diff --git a/src/c11/threads.h b/src/c11/threads.h
+index dbcb3459a9b..c849f385e30 100644
+--- a/src/c11/threads.h
++++ b/src/c11/threads.h
+@@ -118,8 +118,10 @@ typedef pthread_cond_t cnd_t;
+ typedef pthread_t thrd_t;
+ typedef pthread_key_t tss_t;
+ typedef pthread_mutex_t mtx_t;
++#ifndef __once_flag_defined
+ typedef pthread_once_t once_flag;
+ # define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
++#endif
+ # ifdef PTHREAD_DESTRUCTOR_ITERATIONS
+ # define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
+ # else
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 9157fe9c3f..eb23a3f82c 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -19,6 +19,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
file://0001-drisw-fix-build-without-dri3.patch \
file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \
file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \
+ file://0001-c11-threads-fix-build-on-c23.patch \
"
SRC_URI[sha256sum] = "7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [scarthgap][PATCH 2/2] virglrenderer: Fix build with glibc 2.43+
2026-04-10 6:42 [scarthgap][PATCH 1/2] mesa: fix build on host with glibc-2.43 martin.jansa
@ 2026-04-10 6:42 ` martin.jansa
0 siblings, 0 replies; 2+ messages in thread
From: martin.jansa @ 2026-04-10 6:42 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj, Mathieu Dubois-Briand, Martin Jansa
From: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
...once_flag-ONCE_FLAG_INIT-when-presen.patch | 55 +++++++++++++++++++
.../virglrenderer/virglrenderer_1.0.1.bb | 1 +
2 files changed, 56 insertions(+)
create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer/0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch
new file mode 100644
index 0000000000..1740d7605f
--- /dev/null
+++ b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch
@@ -0,0 +1,55 @@
+From 179e744f7577d98df7c79d7324c22acfb32a0154 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@redhat.com>
+Date: Fri, 7 Nov 2025 13:14:56 +1000
+Subject: [PATCH] c11/threads: fix build on c23
+
+C23/glibc is now including once_init in stdlib.h
+
+https://patchwork.sourceware.org/project/glibc/patch/78061085-f04a-0c45-107b-5a8a15521083@redhat.com/#213088
+
+Just fix up our use of it.
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1567]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mesa/compat/c11/impl/threads_posix.c | 3 ++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/mesa/compat/c11/threads_posix.h
++++ b/src/mesa/compat/c11/threads_posix.h
+@@ -51,7 +51,9 @@ Configuration macro:
+ #include <pthread.h>
+
+ /*---------------------------- macros ----------------------------*/
++#ifndef __once_flag_defined
+ #define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
++#endif
+ #ifdef INIT_ONCE_STATIC_INIT
+ #define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
+ #else
+@@ -66,8 +68,9 @@ typedef pthread_cond_t cnd_t;
+ typedef pthread_t thrd_t;
+ typedef pthread_key_t tss_t;
+ typedef pthread_mutex_t mtx_t;
++#ifndef __once_flag_defined
+ typedef pthread_once_t once_flag;
+-
++#endif
+
+ /*
+ Implementation limits:
+@@ -90,12 +93,13 @@ impl_thrd_routine(void *p)
+
+ /*--------------- 7.25.2 Initialization functions ---------------*/
+ // 7.25.2.1
++#ifndef __once_flag_defined
+ static inline void
+ call_once(once_flag *flag, void (*func)(void))
+ {
+ pthread_once(flag, func);
+ }
+-
++#endif
+
+ /*------------- 7.25.3 Condition variable functions -------------*/
+ // 7.25.3.1
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.1.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.1.bb
index 87f25a3461..a6145c15f6 100644
--- a/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.1.bb
+++ b/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.1.bb
@@ -13,6 +13,7 @@ SRCREV = "690680e5f0f952e22424fca1538c1b24457a0868"
SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https \
file://0001-meson.build-use-python3-directly-for-python.patch \
file://0001-vrend-Fix-int-conversion-fatal-build-error-with-GCC-.patch \
+ file://0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch \
"
S = "${WORKDIR}/git"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-10 6:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 6:42 [scarthgap][PATCH 1/2] mesa: fix build on host with glibc-2.43 martin.jansa
2026-04-10 6:42 ` [scarthgap][PATCH 2/2] virglrenderer: Fix build with glibc 2.43+ martin.jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox