* [whinlatter][PATCH] virglrenderer: Fix build with glibc 2.43+
@ 2026-04-10 6:12 martin.jansa
2026-04-11 12:52 ` [OE-core] " Yoann Congal
0 siblings, 1 reply; 3+ messages in thread
From: martin.jansa @ 2026-04-10 6:12 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj, Mathieu Dubois-Briand
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>
---
...once_flag-ONCE_FLAG_INIT-when-presen.patch | 55 +++++++++++++++++++
.../virglrenderer/virglrenderer_1.1.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.1.1.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
index 89dd25de70..be4385ada6 100644
--- a/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
+++ b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
@@ -12,6 +12,7 @@ DEPENDS = "libdrm libepoxy python3-pyyaml-native virtual/egl virtual/libgbm"
SRCREV = "0f1f43929724a6a414c01a29bc51feccb445c2f0"
SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https;tag=${PV} \
file://0001-meson.build-use-python3-directly-for-python.patch \
+ file://0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch \
"
inherit meson pkgconfig features_check
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [whinlatter][PATCH] virglrenderer: Fix build with glibc 2.43+
2026-04-10 6:12 [whinlatter][PATCH] virglrenderer: Fix build with glibc 2.43+ martin.jansa
@ 2026-04-11 12:52 ` Yoann Congal
2026-04-12 9:43 ` Martin Jansa
0 siblings, 1 reply; 3+ messages in thread
From: Yoann Congal @ 2026-04-11 12:52 UTC (permalink / raw)
To: martin.jansa, openembedded-core; +Cc: Khem Raj, Mathieu Dubois-Briand
On Fri Apr 10, 2026 at 8:12 AM CEST, Martin Jansa via lists.openembedded.org wrote:
> 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>
> ---
Thanks Martin,
With this patch, the build progress further but, now, ovmf-native fails to build:
https://autobuilder.yoctoproject.org/valkyrie/?#/builders/96/builds/25/steps/25/logs/stdio (line 16662).
(I could reproduce that locally with my ubuntu26.04 container)
There is a patch for master[0] but the patches inside it do not apply cleanly on the whinlatter version.
[0]: https://lore.kernel.org/openembedded-core/20260409122225.1069828-1-zboszor@gmail.com/
Can you send the backport?
Regards,
> ...once_flag-ONCE_FLAG_INIT-when-presen.patch | 55 +++++++++++++++++++
> .../virglrenderer/virglrenderer_1.1.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.1.1.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> index 89dd25de70..be4385ada6 100644
> --- a/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> @@ -12,6 +12,7 @@ DEPENDS = "libdrm libepoxy python3-pyyaml-native virtual/egl virtual/libgbm"
> SRCREV = "0f1f43929724a6a414c01a29bc51feccb445c2f0"
> SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https;tag=${PV} \
> file://0001-meson.build-use-python3-directly-for-python.patch \
> + file://0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch \
> "
>
> inherit meson pkgconfig features_check
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [whinlatter][PATCH] virglrenderer: Fix build with glibc 2.43+
2026-04-11 12:52 ` [OE-core] " Yoann Congal
@ 2026-04-12 9:43 ` Martin Jansa
0 siblings, 0 replies; 3+ messages in thread
From: Martin Jansa @ 2026-04-12 9:43 UTC (permalink / raw)
To: Yoann Congal; +Cc: openembedded-core, Khem Raj, Mathieu Dubois-Briand
On Sat, Apr 11, 2026 at 2:52 PM Yoann Congal <yoann.congal@smile.fr> wrote:
>
> On Fri Apr 10, 2026 at 8:12 AM CEST, Martin Jansa via lists.openembedded.org wrote:
> > 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>
> > ---
>
> Thanks Martin,
>
> With this patch, the build progress further but, now, ovmf-native fails to build:
> https://autobuilder.yoctoproject.org/valkyrie/?#/builders/96/builds/25/steps/25/logs/stdio (line 16662).
> (I could reproduce that locally with my ubuntu26.04 container)
>
> There is a patch for master[0] but the patches inside it do not apply cleanly on the whinlatter version.
>
> [0]: https://lore.kernel.org/openembedded-core/20260409122225.1069828-1-zboszor@gmail.com/
>
> Can you send the backport?
Hi,
I've sent fix for all 3, the same upstream patches worked for me in
whinlatter and scarthgap (which needed one more backport), but make
sure to apply them with --keep-cr, because the source uses windows
line endings and git am will remove them by default from the ovmf
.patch file embedded in the .patch for oe-core. Or you can cherry-pick
them from my jansa/scarthgap, jansa/whinlatter, jansa/master in
contrib repo (currently top commit in each).
wrynose: https://lore.kernel.org/openembedded-core/20260412093610.805271-1-martin.jansa@gmail.com/T/#u
whinlatter: https://lore.kernel.org/openembedded-core/20260412093637.819659-1-martin.jansa@gmail.com/T/#u
scarthgap: https://lore.kernel.org/openembedded-core/20260412093629.816730-1-martin.jansa@gmail.com/T/#u
I should have read master[0] before doing my own.. lack of coffee on
Sunday morning..
Cheers,
>
> Regards,
>
> > ...once_flag-ONCE_FLAG_INIT-when-presen.patch | 55 +++++++++++++++++++
> > .../virglrenderer/virglrenderer_1.1.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.1.1.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> > index 89dd25de70..be4385ada6 100644
> > --- a/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> > +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_1.1.1.bb
> > @@ -12,6 +12,7 @@ DEPENDS = "libdrm libepoxy python3-pyyaml-native virtual/egl virtual/libgbm"
> > SRCREV = "0f1f43929724a6a414c01a29bc51feccb445c2f0"
> > SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https;tag=${PV} \
> > file://0001-meson.build-use-python3-directly-for-python.patch \
> > + file://0001-c11-use-glibc-s-once_flag-ONCE_FLAG_INIT-when-presen.patch \
> > "
> >
> > inherit meson pkgconfig features_check
>
>
> --
> Yoann Congal
> Smile ECS
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-12 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 6:12 [whinlatter][PATCH] virglrenderer: Fix build with glibc 2.43+ martin.jansa
2026-04-11 12:52 ` [OE-core] " Yoann Congal
2026-04-12 9: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