summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch')
-rw-r--r--recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch b/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch
new file mode 100644
index 00000000..91767406
--- /dev/null
+++ b/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch
@@ -0,0 +1,61 @@
1From 9b7072697616ffd19fcefcd3ec48eec481faf4e6 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Thu, 20 Nov 2025 23:22:59 -0500
4Subject: [PATCH] tools/libxl: Fix build with NOCPUID and json-c
5
6The stub file `tools/libs/light/libxl_nocpuid.c`, used when CPUID
7support is disabled via `CONFIG_NOCPUID`, was incomplete. It was
8missing a stub implementation for the `json-c` function
9`libxl_cpuid_policy_list_gen_jso`.
10
11When building with both `CONFIG_NOCPUID` and `HAVE_LIBJSONC` (which
12is preferred by configure over yajl), auto-generated code in
13`_libxl_types.c` would reference `libxl_cpuid_policy_list_gen_jso`,
14leading to a linker error due to the undefined reference.
15
16Additionally, the file was missing a prototype for the `yajl` function
17`libxl_cpuid_policy_list_gen_json`, causing a compiler error
18(`-Werror=missing-prototypes`) in builds that did manage to select
19`yajl`.
20
21This commit fixes both issues by:
221. Adding the missing function prototype for the `yajl` function.
232. Adding the missing stub implementation for the `json-c` function,
24 guarded by `HAVE_LIBJSONC`.
25
26This ensures that xen-tools can be built successfully in all
27configurations related to CPUID and JSON library selection.
28
29Upstream-Status: Inappropriate [oe specific]
30
31Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
32---
33 tools/libs/light/libxl_nocpuid.c | 15 +++++++++++++++
34 1 file changed, 15 insertions(+)
35
36Index: xen-tools-4.21+stable/tools/libs/light/libxl_nocpuid.c
37===================================================================
38--- xen-tools-4.21+stable.orig/tools/libs/light/libxl_nocpuid.c
39+++ xen-tools-4.21+stable/tools/libs/light/libxl_nocpuid.c
40@@ -16,6 +16,21 @@
41
42 #include <yajl/yajl_gen.h>
43
44+#include "libxl_json.h"
45+
46+#include <yajl/yajl_gen.h>
47+
48+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
49+ libxl_cpuid_policy_list *pcpuid);
50+
51+#ifdef HAVE_LIBJSONC
52+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r,
53+ libxl_cpuid_policy_list *pcpuid)
54+{
55+ return 0;
56+}
57+#endif
58+
59 int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl)
60 {
61 return 1;