diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-11-21 00:32:23 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-11-21 00:39:01 -0800 |
| commit | 2d3394944369dd0e2834092e8c919975c5249aeb (patch) | |
| tree | aacbe734488fef010735aa149d6581283f7efc9c /meta-networking | |
| parent | 3789c3be6d34a7afb117648bb8a522a8493eee21 (diff) | |
| download | meta-openembedded-2d3394944369dd0e2834092e8c919975c5249aeb.tar.gz | |
open-vm-tools: Avoid GLib g_free macro redefinition error
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
2 files changed, 32 insertions, 0 deletions
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 @@ | |||
| 1 | From c21c9a7c1ef89c63c1b124a0f49d95ed6ae8f19d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 21 Nov 2025 00:29:10 -0800 | ||
| 4 | Subject: [PATCH] glib_stubs: avoid GLib g_free macro redefinition error | ||
| 5 | |||
| 6 | glib 2.78+ defines g_free as an object-size checking macro. | ||
| 7 | open-vm-tools overrides g_free(), leading to preprocessor expansion | ||
| 8 | inside the function signature and breaking the build. | ||
| 9 | |||
| 10 | Undefine the macro before defining the stub. | ||
| 11 | |||
| 12 | Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/779] | ||
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 14 | --- | ||
| 15 | open-vm-tools/lib/rpcChannel/glib_stubs.c | 3 +++ | ||
| 16 | 1 file changed, 3 insertions(+) | ||
| 17 | |||
| 18 | diff --git a/open-vm-tools/lib/rpcChannel/glib_stubs.c b/open-vm-tools/lib/rpcChannel/glib_stubs.c | ||
| 19 | index c32deb073..cb89c6a87 100644 | ||
| 20 | --- a/open-vm-tools/lib/rpcChannel/glib_stubs.c | ||
| 21 | +++ b/open-vm-tools/lib/rpcChannel/glib_stubs.c | ||
| 22 | @@ -35,6 +35,9 @@ | ||
| 23 | |||
| 24 | void *g_malloc0(size_t s) { return Util_SafeCalloc(1, s); } | ||
| 25 | void *g_malloc0_n(size_t n, size_t s) { return Util_SafeCalloc(n, s); } | ||
| 26 | +/* GLib defines g_free as a macro, so undefine it before providing | ||
| 27 | + * our own stub implementation. */ | ||
| 28 | +#undef g_free | ||
| 29 | void g_free(void *p) { free(p); } | ||
| 30 | |||
| 31 | 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 | |||
| 43 | file://0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \ | 43 | file://0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \ |
| 44 | file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \ | 44 | file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \ |
| 45 | file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \ | 45 | file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \ |
| 46 | file://0001-glib_stubs-avoid-GLib-g_free-macro-redefinition-erro.patch;patchdir=.. \ | ||
| 46 | " | 47 | " |
| 47 | 48 | ||
| 48 | UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)" | 49 | UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)" |
