diff options
Diffstat (limited to 'sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch')
-rw-r--r-- | sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch new file mode 100644 index 000000000000..ea0b9134c683 --- /dev/null +++ b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch @@ -0,0 +1,168 @@ +https://bugs.gentoo.org/809092 +https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c + +From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001 +From: Zeyad Yasser <zeyady98@gmail.com> +Date: Thu, 22 Jul 2021 11:39:34 +0200 +Subject: [PATCH] protobuf: remove leading underscores from protobuf structs + +Fixes: #1560 + +The latest protobuf-c compiler breaks CRIU because they removed +leading underscores from structs in 1.4.0. + +This replaces those definitions with the standard generated structs. + +v2: remove struct _VmaEntry, struct _CredsEntry and struct _CoreEntry + +Signed-off-by: Zeyad Yasser <zeyady98@gmail.com> +--- + criu/include/irmap.h | 8 +++++--- + criu/include/parasite-syscall.h | 8 +++----- + criu/include/pstree.h | 2 +- + criu/include/rst_info.h | 5 ++--- + criu/include/shmem.h | 1 - + criu/mem.c | 2 +- + lib/c/criu.h | 3 ++- + 7 files changed, 14 insertions(+), 15 deletions(-) + +diff --git a/criu/include/irmap.h b/criu/include/irmap.h +index 033f71e372..188d753f4d 100644 +--- a/criu/include/irmap.h ++++ b/criu/include/irmap.h +@@ -1,13 +1,15 @@ + #ifndef __CR_IRMAP__H__ + #define __CR_IRMAP__H__ ++ ++#include "images/fh.pb-c.h" ++ + char *irmap_lookup(unsigned int s_dev, unsigned long i_ino); +-struct _FhEntry; + int irmap_queue_cache(unsigned int dev, unsigned long ino, +- struct _FhEntry *fh); ++ FhEntry *fh); + int irmap_predump_prep(void); + int irmap_predump_run(void); + int check_open_handle(unsigned int s_dev, unsigned long i_ino, +- struct _FhEntry *f_handle); ++ FhEntry *f_handle); + int irmap_load_cache(void); + int irmap_scan_path_add(char *path); + #endif +diff --git a/criu/include/parasite-syscall.h b/criu/include/parasite-syscall.h +index c86a724fd1..afba95a9e7 100644 +--- a/criu/include/parasite-syscall.h ++++ b/criu/include/parasite-syscall.h +@@ -11,8 +11,6 @@ struct parasite_dump_misc; + struct parasite_drain_fd; + struct vm_area_list; + struct pstree_item; +-struct _CredsEntry; +-struct _CoreEntry; + struct list_head; + struct cr_imgset; + struct fd_opts; +@@ -31,11 +29,11 @@ extern int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc + struct parasite_ctl *ctl, struct pstree_item *); + + extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct parasite_dump_misc *misc); +-extern int parasite_dump_creds(struct parasite_ctl *ctl, struct _CredsEntry *ce); +-extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, struct _CoreEntry *core); ++extern int parasite_dump_creds(struct parasite_ctl *ctl, CredsEntry *ce); ++extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, CoreEntry *core); + extern int parasite_dump_thread_seized(struct parasite_thread_ctl *tctl, + struct parasite_ctl *ctl, int id, +- struct pid *tid, struct _CoreEntry *core); ++ struct pid *tid, CoreEntry *core); + extern int dump_thread_core(int pid, CoreEntry *core, + const struct parasite_dump_thread *dt); + +diff --git a/criu/include/pstree.h b/criu/include/pstree.h +index 61ab0ce0eb..17d22e791e 100644 +--- a/criu/include/pstree.h ++++ b/criu/include/pstree.h +@@ -113,7 +113,7 @@ extern int prepare_task_entries(void); + extern int prepare_dummy_task_state(struct pstree_item *pi); + + extern int get_task_ids(struct pstree_item *); +-extern struct _TaskKobjIdsEntry *root_ids; ++extern TaskKobjIdsEntry *root_ids; + + extern void core_entry_free(CoreEntry *core); + extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc); +diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h +index 3283849e44..3dc119a931 100644 +--- a/criu/include/rst_info.h ++++ b/criu/include/rst_info.h +@@ -5,6 +5,7 @@ + #include "common/list.h" + #include "vma.h" + #include "kerndat.h" ++#include "images/mm.pb-c.h" + + struct task_entries { + int nr_threads, nr_tasks, nr_helpers; +@@ -25,8 +26,6 @@ struct fdt { + futex_t fdt_lock; + }; + +-struct _MmEntry; +- + struct rst_info { + struct list_head fds; + +@@ -40,7 +39,7 @@ struct rst_info { + struct fdt *fdt; + + struct vm_area_list vmas; +- struct _MmEntry *mm; ++ MmEntry *mm; + struct list_head vma_io; + unsigned int pages_img_id; + +diff --git a/criu/include/shmem.h b/criu/include/shmem.h +index 9afdb799af..798e28f347 100644 +--- a/criu/include/shmem.h ++++ b/criu/include/shmem.h +@@ -5,7 +5,6 @@ + #include "common/lock.h" + #include "images/vma.pb-c.h" + +-struct _VmaEntry; + struct vma_area; + + extern int collect_shmem(int pid, struct vma_area *vma); +diff --git a/criu/mem.c b/criu/mem.c +index 9fabe4c470..b0a76e4da9 100644 +--- a/criu/mem.c ++++ b/criu/mem.c +@@ -1230,7 +1230,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr) + + static int maybe_disable_thp(struct pstree_item *t, struct page_read *pr) + { +- struct _MmEntry *mm = rsti(t)->mm; ++ MmEntry *mm = rsti(t)->mm; + + /* + * There is no need to disable it if the page read doesn't +diff --git a/lib/c/criu.h b/lib/c/criu.h +index 3d64939584..d2bfbf958c 100644 +--- a/lib/c/criu.h ++++ b/lib/c/criu.h +@@ -22,6 +22,7 @@ + #include <stdbool.h> + + #include "version.h" ++#include "rpc.pb-c.h" + + #ifdef __GNUG__ + extern "C" { +@@ -112,7 +113,7 @@ void criu_set_pidfd_store_sk(int sk); + * some non-existing one is reported. + */ + +-typedef struct _CriuNotify *criu_notify_arg_t; ++typedef CriuNotify *criu_notify_arg_t; + void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na)); + + /* Get pid of root task. 0 if not available */ |