Signed-off-by: Khem Raj <[email protected]>
---
 .../0001-c11-threads-fix-build-on-c23.patch   | 51 +++++++++++++++++++
 meta/recipes-graphics/waffle/waffle_1.8.1.bb  |  1 +
 2 files changed, 52 insertions(+)
 create mode 100644 
meta/recipes-graphics/waffle/waffle/0001-c11-threads-fix-build-on-c23.patch

diff --git 
a/meta/recipes-graphics/waffle/waffle/0001-c11-threads-fix-build-on-c23.patch 
b/meta/recipes-graphics/waffle/waffle/0001-c11-threads-fix-build-on-c23.patch
new file mode 100644
index 00000000000..4082a763e16
--- /dev/null
+++ 
b/meta/recipes-graphics/waffle/waffle/0001-c11-threads-fix-build-on-c23.patch
@@ -0,0 +1,51 @@
+From 6b3c46483844faba4dfe7dd90dc2b0cd06e67158 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 10 Nov 2025 19:20:22 -0800
+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/[email protected]/#213088
+
+Conditionally check if glibc already provided c23 definition via stdlib.h
+
+Upstream-Status: Submitted 
[https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/158]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ third_party/threads/threads.h       | 3 ++-
+ third_party/threads/threads_posix.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/threads/threads.h b/third_party/threads/threads.h
+index b4db50c..cdc7bea 100644
+--- a/third_party/threads/threads.h
++++ b/third_party/threads/threads.h
+@@ -102,8 +102,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
+ #else
+ #error Not supported on this platform.
+ #endif
+diff --git a/third_party/threads/threads_posix.c 
b/third_party/threads/threads_posix.c
+index bc50825..d93013b 100644
+--- a/third_party/threads/threads_posix.c
++++ b/third_party/threads/threads_posix.c
+@@ -75,11 +75,12 @@ static void *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/meta/recipes-graphics/waffle/waffle_1.8.1.bb 
b/meta/recipes-graphics/waffle/waffle_1.8.1.bb
index 606881e0c91..aefa0069cf2 100644
--- a/meta/recipes-graphics/waffle/waffle_1.8.1.bb
+++ b/meta/recipes-graphics/waffle/waffle_1.8.1.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = 
"file://LICENSE.txt;md5=4c5154407c2490750dd461c50ad94797 \
                     
file://include/waffle-1/waffle.h;endline=24;md5=61dbf8697f61c78645e75a93c585b1bf"
 
 SRC_URI = 
"git://gitlab.freedesktop.org/mesa/waffle.git;protocol=https;branch=maint-1.8 \
+           file://0001-c11-threads-fix-build-on-c23.patch \
            "
 SRCREV = "49abc7cb5f73cc6852136c91da49ea3a338960e4"
 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226141): 
https://lists.openembedded.org/g/openembedded-core/message/226141
Mute This Topic: https://lists.openembedded.org/mt/116233140/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to