summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch')
-rw-r--r--meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch187
1 files changed, 118 insertions, 69 deletions
diff --git a/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
index 65f4ef9a55..531a562967 100644
--- a/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
+++ b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
@@ -1,16 +1,37 @@
1commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa 1Upstream-Status: Backport
2Author: Isaac Dunham <ibid.ag@gmail.com> 2Signed-off-by: Ross Burton <ross.burton@arm.com>
3Date: Fri Sep 5 22:35:32 2014 -0700
4 3
5 Remove __.*DECLS nonsense 4From 26f2889113789c176273bd24fcd1592a8064c346 Mon Sep 17 00:00:00 2001
5From: "Anthony G. Basile" <blueness@gentoo.org>
6Date: Tue, 6 Jul 2021 07:54:47 -0600
7Subject: [PATCH 1/2] Replace __BEGIN_DECLS and __END_DECLS with extern "C".
6 8
7Upstream-Status: Pending 9The macros __BEGIN_DECLS and __END_DECLS are a GNU-ism found in
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 10glibc and uClibc, but not musl. We replace them by the more general
11extern "C" { ... } block exposed only if we have __cplusplus.
9 12
10Index: libcgroup-0.41/include/libcgroup/config.h 13Forward ported from a patch by Anthony G. Basile <blueness@gentoo.org>.
11=================================================================== 14
12--- libcgroup-0.41.orig/include/libcgroup/config.h 15Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
13+++ libcgroup-0.41/include/libcgroup/config.h 16Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
17---
18 include/libcgroup/config.h | 8 ++++++--
19 include/libcgroup/error.h | 8 ++++++--
20 include/libcgroup/groups.h | 8 ++++++--
21 include/libcgroup/init.h | 8 ++++++--
22 include/libcgroup/iterators.h | 8 ++++++--
23 include/libcgroup/log.h | 8 ++++++--
24 include/libcgroup/tasks.h | 8 ++++++--
25 src/bindings/libcgroup.p | 8 --------
26 src/daemon/cgrulesengd.h | 8 ++++++--
27 src/libcgroup-internal.h | 8 ++++++--
28 src/tools/tools-common.h | 8 ++++++--
29 11 files changed, 60 insertions(+), 28 deletions(-)
30
31diff --git a/include/libcgroup/config.h b/include/libcgroup/config.h
32index 9aaa390..f835009 100644
33--- a/include/libcgroup/config.h
34+++ b/include/libcgroup/config.h
14@@ -9,7 +9,9 @@ 35@@ -9,7 +9,9 @@
15 #include <features.h> 36 #include <features.h>
16 #endif 37 #endif
@@ -22,20 +43,20 @@ Index: libcgroup-0.41/include/libcgroup/config.h
22 43
23 /** 44 /**
24 * @defgroup group_config 5. Configuration 45 * @defgroup group_config 5. Configuration
25@@ -107,6 +109,8 @@ int cgroup_config_create_template_group( 46@@ -128,6 +130,8 @@ int cgroup_config_create_template_group(
26 * @} 47 * @}
27 * @} 48 * @}
28 */ 49 */
29-__END_DECLS 50-__END_DECLS
30+#ifdef __cplusplus 51+#ifdef __cplusplus
31+} 52+} /* extern "C" */
32+#endif 53+#endif
33 54
34 #endif /*_LIBCGROUP_CONFIG_H*/ 55 #endif /*_LIBCGROUP_CONFIG_H*/
35Index: libcgroup-0.41/include/libcgroup/error.h 56diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
36=================================================================== 57index 1dfdde9..14a6e16 100644
37--- libcgroup-0.41.orig/include/libcgroup/error.h 58--- a/include/libcgroup/error.h
38+++ libcgroup-0.41/include/libcgroup/error.h 59+++ b/include/libcgroup/error.h
39@@ -9,7 +9,9 @@ 60@@ -9,7 +9,9 @@
40 #include <features.h> 61 #include <features.h>
41 #endif 62 #endif
@@ -53,14 +74,14 @@ Index: libcgroup-0.41/include/libcgroup/error.h
53 */ 74 */
54-__END_DECLS 75-__END_DECLS
55+#ifdef __cplusplus 76+#ifdef __cplusplus
56+} 77+} /* extern "C" */
57+#endif 78+#endif
58 79
59 #endif /* _LIBCGROUP_INIT_H */ 80 #endif /* _LIBCGROUP_INIT_H */
60Index: libcgroup-0.41/include/libcgroup/groups.h 81diff --git a/include/libcgroup/groups.h b/include/libcgroup/groups.h
61=================================================================== 82index 201558f..39ec3cd 100644
62--- libcgroup-0.41.orig/include/libcgroup/groups.h 83--- a/include/libcgroup/groups.h
63+++ libcgroup-0.41/include/libcgroup/groups.h 84+++ b/include/libcgroup/groups.h
64@@ -11,7 +11,9 @@ 85@@ -11,7 +11,9 @@
65 #include <stdbool.h> 86 #include <stdbool.h>
66 #endif 87 #endif
@@ -72,20 +93,20 @@ Index: libcgroup-0.41/include/libcgroup/groups.h
72 93
73 /** 94 /**
74 * Flags for cgroup_delete_cgroup_ext(). 95 * Flags for cgroup_delete_cgroup_ext().
75@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro 96@@ -587,6 +589,8 @@ char *cgroup_get_cgroup_name(struct cgroup *cgroup);
76 */ 97 */
77 98
78 99
79-__END_DECLS 100-__END_DECLS
80+#ifdef __cplusplus 101+#ifdef __cplusplus
81+} 102+} /* extern "C" */
82+#endif 103+#endif
83 104
84 #endif /* _LIBCGROUP_GROUPS_H */ 105 #endif /* _LIBCGROUP_GROUPS_H */
85Index: libcgroup-0.41/include/libcgroup/init.h 106diff --git a/include/libcgroup/init.h b/include/libcgroup/init.h
86=================================================================== 107index 5150f2f..ea2dcc9 100644
87--- libcgroup-0.41.orig/include/libcgroup/init.h 108--- a/include/libcgroup/init.h
88+++ libcgroup-0.41/include/libcgroup/init.h 109+++ b/include/libcgroup/init.h
89@@ -9,7 +9,9 @@ 110@@ -9,7 +9,9 @@
90 #include <features.h> 111 #include <features.h>
91 #endif 112 #endif
@@ -97,20 +118,20 @@ Index: libcgroup-0.41/include/libcgroup/init.h
97 118
98 /** 119 /**
99 * @defgroup group_init 1. Initialization 120 * @defgroup group_init 1. Initialization
100@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const 121@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
101 * @} 122 * @}
102 * @} 123 * @}
103 */ 124 */
104-__END_DECLS 125-__END_DECLS
105+#ifdef __cplusplus 126+#ifdef __cplusplus
106+} 127+} /* extern "C" */
107+#endif 128+#endif
108 129
109 #endif /* _LIBCGROUP_INIT_H */ 130 #endif /* _LIBCGROUP_INIT_H */
110Index: libcgroup-0.41/include/libcgroup/iterators.h 131diff --git a/include/libcgroup/iterators.h b/include/libcgroup/iterators.h
111=================================================================== 132index c6d453d..b3ba3af 100644
112--- libcgroup-0.41.orig/include/libcgroup/iterators.h 133--- a/include/libcgroup/iterators.h
113+++ libcgroup-0.41/include/libcgroup/iterators.h 134+++ b/include/libcgroup/iterators.h
114@@ -11,7 +11,9 @@ 135@@ -11,7 +11,9 @@
115 #include <features.h> 136 #include <features.h>
116 #endif 137 #endif
@@ -122,20 +143,45 @@ Index: libcgroup-0.41/include/libcgroup/iterators.h
122 143
123 /** 144 /**
124 * @defgroup group_iterators 3. Iterators 145 * @defgroup group_iterators 3. Iterators
125@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo 146@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(void **handle);
126 * @} 147 * @}
127 */ 148 */
128 149
129-__END_DECLS 150-__END_DECLS
130+#ifdef __cplusplus 151+#ifdef __cplusplus
131+} 152+} /* extern "C" */
132+#endif 153+#endif
133 154
134 #endif /* _LIBCGROUP_ITERATORS_H */ 155 #endif /* _LIBCGROUP_ITERATORS_H */
135Index: libcgroup-0.41/include/libcgroup/tasks.h 156diff --git a/include/libcgroup/log.h b/include/libcgroup/log.h
136=================================================================== 157index 0dd03b4..f693473 100644
137--- libcgroup-0.41.orig/include/libcgroup/tasks.h 158--- a/include/libcgroup/log.h
138+++ libcgroup-0.41/include/libcgroup/tasks.h 159+++ b/include/libcgroup/log.h
160@@ -11,7 +11,9 @@
161
162 #include <stdarg.h>
163
164-__BEGIN_DECLS
165+#ifdef __cplusplus
166+extern "C" {
167+#endif
168
169 /**
170 * @defgroup group_log 7. Logging
171@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(const char *levelstr);
172 * @}
173 * @}
174 */
175-__END_DECLS
176+#ifdef __cplusplus
177+} /* extern "C" */
178+#endif
179
180 #endif /* _LIBCGROUP_LOG_H */
181diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h
182index aad438a..8553c30 100644
183--- a/include/libcgroup/tasks.h
184+++ b/include/libcgroup/tasks.h
139@@ -12,7 +12,9 @@ 185@@ -12,7 +12,9 @@
140 #include <stdbool.h> 186 #include <stdbool.h>
141 #endif 187 #endif
@@ -147,20 +193,20 @@ Index: libcgroup-0.41/include/libcgroup/tasks.h
147 193
148 /** Flags for cgroup_change_cgroup_uid_gid(). */ 194 /** Flags for cgroup_change_cgroup_uid_gid(). */
149 enum cgflags { 195 enum cgflags {
150@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi 196@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
151 * @} 197 * @}
152 * @} 198 * @}
153 */ 199 */
154-__END_DECLS 200-__END_DECLS
155+#ifdef __cplusplus 201+#ifdef __cplusplus
156+} 202+} /* extern "C" */
157+#endif 203+#endif
158 204
159 #endif /* _LIBCGROUP_TASKS_H */ 205 #endif /* _LIBCGROUP_TASKS_H */
160Index: libcgroup-0.41/src/daemon/cgrulesengd.h 206diff --git a/src/daemon/cgrulesengd.h b/src/daemon/cgrulesengd.h
161=================================================================== 207index e273b4b..0b12076 100644
162--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h 208--- a/src/daemon/cgrulesengd.h
163+++ libcgroup-0.41/src/daemon/cgrulesengd.h 209+++ b/src/daemon/cgrulesengd.h
164@@ -17,7 +17,9 @@ 210@@ -17,7 +17,9 @@
165 211
166 #include <features.h> 212 #include <features.h>
@@ -178,15 +224,15 @@ Index: libcgroup-0.41/src/daemon/cgrulesengd.h
178 224
179-__END_DECLS 225-__END_DECLS
180+#ifdef __cplusplus 226+#ifdef __cplusplus
181+} 227+} /* extern "C" */
182+#endif 228+#endif
183 229
184 #endif /* _CGRULESENGD_H */ 230 #endif /* _CGRULESENGD_H */
185 231
186Index: libcgroup-0.41/src/libcgroup-internal.h 232diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
187=================================================================== 233index 1dfc92b..edc5abb 100644
188--- libcgroup-0.41.orig/src/libcgroup-internal.h 234--- a/src/libcgroup-internal.h
189+++ libcgroup-0.41/src/libcgroup-internal.h 235+++ b/src/libcgroup-internal.h
190@@ -16,7 +16,9 @@ 236@@ -16,7 +16,9 @@
191 237
192 #define __LIBCG_INTERNAL 238 #define __LIBCG_INTERNAL
@@ -197,39 +243,42 @@ Index: libcgroup-0.41/src/libcgroup-internal.h
197+#endif 243+#endif
198 244
199 #include "config.h" 245 #include "config.h"
200 #include <fts.h> 246 #include <dirent.h>
201@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e 247@@ -407,6 +409,8 @@ int cgroupv2_controller_enabled(const char * const cg_name,
202 */ 248
203 int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask); 249 #endif /* UNIT_TEST */
204 250
205-__END_DECLS 251-__END_DECLS
206+#ifdef __cplusplus 252+#ifdef __cplusplus
207+} 253+} /* extern "C" */
208+#endif 254+#endif
209 255
210 #endif 256 #endif
211Index: libcgroup-0.41/include/libcgroup/log.h 257diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h
212=================================================================== 258index 292c408..e3541b1 100644
213--- libcgroup-0.41.orig/include/libcgroup/log.h 259--- a/src/tools/tools-common.h
214+++ libcgroup-0.41/include/libcgroup/log.h 260+++ b/src/tools/tools-common.h
215@@ -11,7 +11,9 @@ 261@@ -18,7 +18,9 @@
216 262
217 #include <stdarg.h> 263 #define __TOOLS_COMMON
218 264
219-__BEGIN_DECLS 265-__BEGIN_DECLS
220+#ifdef __cplusplus 266+#ifdef __cplusplus
221+extern "C" { 267+extern "C" {
222+#endif 268+#endif
269 #include "config.h"
270 #include <libcgroup.h>
271 #include "../libcgroup-internal.h"
272@@ -136,6 +138,8 @@ int parse_r_flag(const char * const program_name,
273
274 #endif /* UNIT_TEST */
223 275
224 /**
225 * @defgroup group_log 7. Logging
226@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
227 * @}
228 * @}
229 */
230-__END_DECLS 276-__END_DECLS
231+#ifdef __cplusplus 277+#ifdef __cplusplus
232+} 278+} /* extern "C" */
233+#endif 279+#endif
234 280
235 #endif /* _LIBCGROUP_LOG_H */ 281 #endif /* TOOLS_COMMON */
282--
2832.32.0
284