Signed-off-by: Khem Raj <[email protected]>
---
 ...-GLib-g_free-macro-redefinition-erro.patch | 31 +++++++++++++++++++
 .../open-vm-tools/open-vm-tools_13.0.5.bb     |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 
meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch

diff --git 
a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch
 
b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch
new file mode 100644
index 0000000000..b5142fa23a
--- /dev/null
+++ 
b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch
@@ -0,0 +1,31 @@
+From c21c9a7c1ef89c63c1b124a0f49d95ed6ae8f19d Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 21 Nov 2025 00:29:10 -0800
+Subject: [PATCH] glib_stubs: avoid GLib g_free macro redefinition error
+
+glib 2.78+ defines g_free as an object-size checking macro.
+open-vm-tools overrides g_free(), leading to preprocessor expansion
+inside the function signature and breaking the build.
+
+Undefine the macro before defining the stub.
+
+Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/779]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ open-vm-tools/lib/rpcChannel/glib_stubs.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/open-vm-tools/lib/rpcChannel/glib_stubs.c 
b/open-vm-tools/lib/rpcChannel/glib_stubs.c
+index c32deb073..cb89c6a87 100644
+--- a/open-vm-tools/lib/rpcChannel/glib_stubs.c
++++ b/open-vm-tools/lib/rpcChannel/glib_stubs.c
+@@ -35,6 +35,9 @@
+
+ void *g_malloc0(size_t s) { return Util_SafeCalloc(1, s); }
+ void *g_malloc0_n(size_t n, size_t s) { return Util_SafeCalloc(n, s); }
++/* GLib defines g_free as a macro, so undefine it before providing
++ * our own stub implementation. */
++#undef g_free
+ void g_free(void *p) { free(p); }
+
+ void g_mutex_init(GMutex *mutex) { }
diff --git 
a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.5.bb 
b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.5.bb
index 304d910940..ac641e0327 100644
--- a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.5.bb
+++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_13.0.5.bb
@@ -43,6 +43,7 @@ SRC_URI = 
"git://github.com/vmware/open-vm-tools.git;protocol=https;branch=stabl
            
file://0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. 
\
            
file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \
            
file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \
+           
file://0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch;patchdir=..
 \
            "

 UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#121960): 
https://lists.openembedded.org/g/openembedded-devel/message/121960
Mute This Topic: https://lists.openembedded.org/mt/116405068/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to