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 @@
-commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
-Author: Isaac Dunham <ibid.ag@gmail.com>
-Date: Fri Sep 5 22:35:32 2014 -0700
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
- Remove __.*DECLS nonsense
+From 26f2889113789c176273bd24fcd1592a8064c346 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Tue, 6 Jul 2021 07:54:47 -0600
+Subject: [PATCH 1/2] Replace __BEGIN_DECLS and __END_DECLS with extern "C".
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
+The macros __BEGIN_DECLS and __END_DECLS are a GNU-ism found in
+glibc and uClibc, but not musl. We replace them by the more general
+extern "C" { ... } block exposed only if we have __cplusplus.
-Index: libcgroup-0.41/include/libcgroup/config.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/config.h
-+++ libcgroup-0.41/include/libcgroup/config.h
+Forward ported from a patch by Anthony G. Basile <blueness@gentoo.org>.
+
+Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
+Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
+---
+ include/libcgroup/config.h | 8 ++++++--
+ include/libcgroup/error.h | 8 ++++++--
+ include/libcgroup/groups.h | 8 ++++++--
+ include/libcgroup/init.h | 8 ++++++--
+ include/libcgroup/iterators.h | 8 ++++++--
+ include/libcgroup/log.h | 8 ++++++--
+ include/libcgroup/tasks.h | 8 ++++++--
+ src/bindings/libcgroup.p | 8 --------
+ src/daemon/cgrulesengd.h | 8 ++++++--
+ src/libcgroup-internal.h | 8 ++++++--
+ src/tools/tools-common.h | 8 ++++++--
+ 11 files changed, 60 insertions(+), 28 deletions(-)
+
+diff --git a/include/libcgroup/config.h b/include/libcgroup/config.h
+index 9aaa390..f835009 100644
+--- a/include/libcgroup/config.h
++++ b/include/libcgroup/config.h
@@ -9,7 +9,9 @@
#include <features.h>
#endif
@@ -22,20 +43,20 @@ Index: libcgroup-0.41/include/libcgroup/config.h
/**
* @defgroup group_config 5. Configuration
-@@ -107,6 +109,8 @@ int cgroup_config_create_template_group(
+@@ -128,6 +130,8 @@ int cgroup_config_create_template_group(
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /*_LIBCGROUP_CONFIG_H*/
-Index: libcgroup-0.41/include/libcgroup/error.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/error.h
-+++ libcgroup-0.41/include/libcgroup/error.h
+diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
+index 1dfdde9..14a6e16 100644
+--- a/include/libcgroup/error.h
++++ b/include/libcgroup/error.h
@@ -9,7 +9,9 @@
#include <features.h>
#endif
@@ -53,14 +74,14 @@ Index: libcgroup-0.41/include/libcgroup/error.h
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_INIT_H */
-Index: libcgroup-0.41/include/libcgroup/groups.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/groups.h
-+++ libcgroup-0.41/include/libcgroup/groups.h
+diff --git a/include/libcgroup/groups.h b/include/libcgroup/groups.h
+index 201558f..39ec3cd 100644
+--- a/include/libcgroup/groups.h
++++ b/include/libcgroup/groups.h
@@ -11,7 +11,9 @@
#include <stdbool.h>
#endif
@@ -72,20 +93,20 @@ Index: libcgroup-0.41/include/libcgroup/groups.h
/**
* Flags for cgroup_delete_cgroup_ext().
-@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro
+@@ -587,6 +589,8 @@ char *cgroup_get_cgroup_name(struct cgroup *cgroup);
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_GROUPS_H */
-Index: libcgroup-0.41/include/libcgroup/init.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/init.h
-+++ libcgroup-0.41/include/libcgroup/init.h
+diff --git a/include/libcgroup/init.h b/include/libcgroup/init.h
+index 5150f2f..ea2dcc9 100644
+--- a/include/libcgroup/init.h
++++ b/include/libcgroup/init.h
@@ -9,7 +9,9 @@
#include <features.h>
#endif
@@ -97,20 +118,20 @@ Index: libcgroup-0.41/include/libcgroup/init.h
/**
* @defgroup group_init 1. Initialization
-@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const
+@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_INIT_H */
-Index: libcgroup-0.41/include/libcgroup/iterators.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/iterators.h
-+++ libcgroup-0.41/include/libcgroup/iterators.h
+diff --git a/include/libcgroup/iterators.h b/include/libcgroup/iterators.h
+index c6d453d..b3ba3af 100644
+--- a/include/libcgroup/iterators.h
++++ b/include/libcgroup/iterators.h
@@ -11,7 +11,9 @@
#include <features.h>
#endif
@@ -122,20 +143,45 @@ Index: libcgroup-0.41/include/libcgroup/iterators.h
/**
* @defgroup group_iterators 3. Iterators
-@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(void **handle);
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_ITERATORS_H */
-Index: libcgroup-0.41/include/libcgroup/tasks.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/tasks.h
-+++ libcgroup-0.41/include/libcgroup/tasks.h
+diff --git a/include/libcgroup/log.h b/include/libcgroup/log.h
+index 0dd03b4..f693473 100644
+--- a/include/libcgroup/log.h
++++ b/include/libcgroup/log.h
+@@ -11,7 +11,9 @@
+
+ #include <stdarg.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_log 7. Logging
+@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(const char *levelstr);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++} /* extern "C" */
++#endif
+
+ #endif /* _LIBCGROUP_LOG_H */
+diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h
+index aad438a..8553c30 100644
+--- a/include/libcgroup/tasks.h
++++ b/include/libcgroup/tasks.h
@@ -12,7 +12,9 @@
#include <stdbool.h>
#endif
@@ -147,20 +193,20 @@ Index: libcgroup-0.41/include/libcgroup/tasks.h
/** Flags for cgroup_change_cgroup_uid_gid(). */
enum cgflags {
-@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi
+@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
* @}
* @}
*/
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _LIBCGROUP_TASKS_H */
-Index: libcgroup-0.41/src/daemon/cgrulesengd.h
-===================================================================
---- libcgroup-0.41.orig/src/daemon/cgrulesengd.h
-+++ libcgroup-0.41/src/daemon/cgrulesengd.h
+diff --git a/src/daemon/cgrulesengd.h b/src/daemon/cgrulesengd.h
+index e273b4b..0b12076 100644
+--- a/src/daemon/cgrulesengd.h
++++ b/src/daemon/cgrulesengd.h
@@ -17,7 +17,9 @@
#include <features.h>
@@ -178,15 +224,15 @@ Index: libcgroup-0.41/src/daemon/cgrulesengd.h
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif /* _CGRULESENGD_H */
-Index: libcgroup-0.41/src/libcgroup-internal.h
-===================================================================
---- libcgroup-0.41.orig/src/libcgroup-internal.h
-+++ libcgroup-0.41/src/libcgroup-internal.h
+diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
+index 1dfc92b..edc5abb 100644
+--- a/src/libcgroup-internal.h
++++ b/src/libcgroup-internal.h
@@ -16,7 +16,9 @@
#define __LIBCG_INTERNAL
@@ -197,39 +243,42 @@ Index: libcgroup-0.41/src/libcgroup-internal.h
+#endif
#include "config.h"
- #include <fts.h>
-@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e
- */
- int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+ #include <dirent.h>
+@@ -407,6 +409,8 @@ int cgroupv2_controller_enabled(const char * const cg_name,
+
+ #endif /* UNIT_TEST */
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
#endif
-Index: libcgroup-0.41/include/libcgroup/log.h
-===================================================================
---- libcgroup-0.41.orig/include/libcgroup/log.h
-+++ libcgroup-0.41/include/libcgroup/log.h
-@@ -11,7 +11,9 @@
+diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h
+index 292c408..e3541b1 100644
+--- a/src/tools/tools-common.h
++++ b/src/tools/tools-common.h
+@@ -18,7 +18,9 @@
- #include <stdarg.h>
+ #define __TOOLS_COMMON
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
+ #include "config.h"
+ #include <libcgroup.h>
+ #include "../libcgroup-internal.h"
+@@ -136,6 +138,8 @@ int parse_r_flag(const char * const program_name,
+
+ #endif /* UNIT_TEST */
- /**
- * @defgroup group_log 7. Logging
-@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
- * @}
- * @}
- */
-__END_DECLS
+#ifdef __cplusplus
-+}
++} /* extern "C" */
+#endif
- #endif /* _LIBCGROUP_LOG_H */
+ #endif /* TOOLS_COMMON */
+--
+2.32.0
+