summaryrefslogtreecommitdiffstats
path: root/recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch')
-rw-r--r--recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch113
1 files changed, 113 insertions, 0 deletions
diff --git a/recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch b/recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch
new file mode 100644
index 000000000..c1e3eaa25
--- /dev/null
+++ b/recipes-extended/jailhouse/files/0001-YOCIMX-9281-1-Fix-gcc15-errors.patch
@@ -0,0 +1,113 @@
1From 2be7793ca658015470fe0d60c0c973e12ce68d73 Mon Sep 17 00:00:00 2001
2From: Tom Hochstein <tom.hochstein@nxp.com>
3Date: Thu, 12 Jun 2025 06:49:58 -0700
4Subject: [PATCH 1/2] YOCIMX-9281-1: Fix gcc15 errors
5
6Fix several instances of the following errors:
7
8```
9| inmates/lib/include/inmate_common.h:87:16: error: cannot use keyword 'true' as enumeration constant
10| 87 | typedef enum { true = 1, false = 0 } bool;
11| | ^~~~
12```
13
14```
15| In file included from configs/arm64/hikey.c:16:
16| include/jailhouse/cell-config.h:318:41: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (6 chars into 5 available) [-Werror=unterminated-string-initialization]
17| 318 | #define JAILHOUSE_SYSTEM_SIGNATURE "JHSYS"
18| | ^~~~~~~
19| configs/arm64/hikey.c:26:30: note: in expansion of macro 'JAILHOUSE_SYSTEM_SIGNATURE'
20| 26 | .signature = JAILHOUSE_SYSTEM_SIGNATURE,
21| | ^~~~~~~~~~~~~~~~~~~~~~~~~~
22```
23
24Upstream-Status: Backport [Pending]
25Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
26Signed-off-by: Peng Fan <peng.fan@nxp.com>
27---
28 hypervisor/include/jailhouse/header.h | 2 +-
29 hypervisor/include/jailhouse/types.h | 2 ++
30 include/jailhouse/cell-config.h | 4 ++--
31 include/jailhouse/hypercall.h | 2 +-
32 inmates/lib/include/inmate_common.h | 2 ++
33 5 files changed, 8 insertions(+), 4 deletions(-)
34
35diff --git a/hypervisor/include/jailhouse/header.h b/hypervisor/include/jailhouse/header.h
36index 518bc5cb..324eb94b 100644
37--- a/hypervisor/include/jailhouse/header.h
38+++ b/hypervisor/include/jailhouse/header.h
39@@ -55,7 +55,7 @@ struct jailhouse_header {
40 /** Signature "JAILHOUS" used for basic validity check of the
41 * hypervisor image.
42 * @note Filled at build time. */
43- char signature[8];
44+ char signature[8] __attribute__ ((nonstring));
45 /** Size of hypervisor core.
46 * It starts with the hypervisor's header and ends after its bss
47 * section. Rounded up to page boundary.
48diff --git a/hypervisor/include/jailhouse/types.h b/hypervisor/include/jailhouse/types.h
49index 6d78ad6d..f79d7428 100644
50--- a/hypervisor/include/jailhouse/types.h
51+++ b/hypervisor/include/jailhouse/types.h
52@@ -19,7 +19,9 @@
53
54 #ifndef __ASSEMBLY__
55
56+#if __GNUC__ < 15
57 typedef enum { true = 1, false = 0 } bool;
58+#endif
59
60 /** Describes a CPU set. */
61 struct cpu_set {
62diff --git a/include/jailhouse/cell-config.h b/include/jailhouse/cell-config.h
63index 17d59306..affce1c2 100644
64--- a/include/jailhouse/cell-config.h
65+++ b/include/jailhouse/cell-config.h
66@@ -91,7 +91,7 @@
67 * structure.
68 */
69 struct jailhouse_cell_desc {
70- char signature[5];
71+ char signature[5] __attribute__ ((nonstring));
72 __u8 architecture;
73 __u16 revision;
74
75@@ -330,7 +330,7 @@ struct jailhouse_pio {
76 * General descriptor of the system.
77 */
78 struct jailhouse_system {
79- char signature[5];
80+ char signature[5] __attribute__ ((nonstring));
81 __u8 architecture;
82 __u16 revision;
83
84diff --git a/include/jailhouse/hypercall.h b/include/jailhouse/hypercall.h
85index 07574d3d..cf58a4c9 100644
86--- a/include/jailhouse/hypercall.h
87+++ b/include/jailhouse/hypercall.h
88@@ -107,7 +107,7 @@
89
90 #define COMM_REGION_GENERIC_HEADER \
91 /** Communication region magic JHCOMM */ \
92- char signature[6]; \
93+ char signature[6] __attribute__ ((nonstring)); \
94 /** Communication region ABI revision */ \
95 __u16 revision; \
96 /** Cell state, initialized by hypervisor, updated by cell. */ \
97diff --git a/inmates/lib/include/inmate_common.h b/inmates/lib/include/inmate_common.h
98index 1c20a0af..43cd7a20 100644
99--- a/inmates/lib/include/inmate_common.h
100+++ b/inmates/lib/include/inmate_common.h
101@@ -84,7 +84,9 @@ typedef u32 __u32;
102 typedef s64 __s64;
103 typedef u64 __u64;
104
105+#if __GNUC__ < 15
106 typedef enum { true = 1, false = 0 } bool;
107+#endif
108
109 #include <jailhouse/hypercall.h>
110
111--
1122.34.1
113