Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
Date: Sat, 25 Apr 2020 11:29:48
Message-Id: 1587814177.58bfbf51627caf280e9b644e5df8f4f0f35ffd54.slyfox@gentoo
1 commit: 58bfbf51627caf280e9b644e5df8f4f0f35ffd54
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 25 11:27:14 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 25 11:29:37 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58bfbf51
7
8 sys-process/criu: tweak for gcc-10, bug #707942
9
10 Closes: https://bugs.gentoo.org/707942
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
13
14 sys-process/criu/criu-3.12.ebuild | 3 +-
15 sys-process/criu/files/criu-3.12-gcc-10.patch | 76 +++++++++++++++++++++++++++
16 2 files changed, 78 insertions(+), 1 deletion(-)
17
18 diff --git a/sys-process/criu/criu-3.12.ebuild b/sys-process/criu/criu-3.12.ebuild
19 index 9321be89fc0..7b5158f5f9b 100644
20 --- a/sys-process/criu/criu-3.12.ebuild
21 +++ b/sys-process/criu/criu-3.12.ebuild
22 @@ -1,4 +1,4 @@
23 -# Copyright 1999-2019 Gentoo Authors
24 +# Copyright 1999-2020 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 EAPI=6
28 @@ -47,6 +47,7 @@ PATCHES=(
29 "${FILESDIR}"/2.2/${PN}-2.2-flags.patch
30 "${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
31 "${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
32 + "${FILESDIR}"/${PN}-3.12-gcc-10.patch # backport
33 )
34
35 criu_arch() {
36
37 diff --git a/sys-process/criu/files/criu-3.12-gcc-10.patch b/sys-process/criu/files/criu-3.12-gcc-10.patch
38 new file mode 100644
39 index 00000000000..ff277b5b22d
40 --- /dev/null
41 +++ b/sys-process/criu/files/criu-3.12-gcc-10.patch
42 @@ -0,0 +1,76 @@
43 +https://bugs.gentoo.org/707942
44 +
45 +From 10d9dcdb6e2fbe4646ff3f27cd35376ebaeeb0f9 Mon Sep 17 00:00:00 2001
46 +From: Sergei Trofimovich <slyfox@g.o>
47 +Date: Sun, 2 Feb 2020 18:45:59 +0000
48 +Subject: [PATCH] criu: fix build failure against gcc-10
49 +MIME-Version: 1.0
50 +Content-Type: text/plain; charset=UTF-8
51 +Content-Transfer-Encoding: 8bit
52 +
53 +On gcc-10 (and gcc-9 -fno-common) build fails as:
54 +
55 +```
56 +ld: criu/arch/x86/crtools.o:criu/include/cr_options.h:159:
57 + multiple definition of `rpc_cfg_file'; criu/arch/x86/cpu.o:criu/include/cr_options.h:159: first defined here
58 +make[2]: *** [scripts/nmk/scripts/build.mk:164: criu/arch/x86/crtools.built-in.o] Error 1
59 +```
60 +
61 +gcc-10 will change the default from -fcommon to fno-common:
62 +https://gcc.gnu.org/PR85678.
63 +
64 +The error also happens if CFLAGS=-fno-common passed explicitly.
65 +
66 +Reported-by: Toralf Förster
67 +Bug: https://bugs.gentoo.org/707942
68 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
69 +---
70 + criu/config.c | 1 +
71 + criu/include/cr_options.h | 2 +-
72 + criu/include/pstree.h | 2 +-
73 + criu/include/tun.h | 2 +-
74 + 4 files changed, 4 insertions(+), 3 deletions(-)
75 +
76 +--- a/criu/config.c
77 ++++ b/criu/config.c
78 +@@ -30,6 +30,7 @@
79 + #include "common/xmalloc.h"
80 +
81 + struct cr_options opts;
82 ++char *rpc_cfg_file;
83 +
84 + static int count_elements(char **to_count)
85 + {
86 +--- a/criu/include/cr_options.h
87 ++++ b/criu/include/cr_options.h
88 +@@ -156,7 +156,7 @@ struct cr_options {
89 + };
90 +
91 + extern struct cr_options opts;
92 +-char *rpc_cfg_file;
93 ++extern char *rpc_cfg_file;
94 +
95 + extern int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd, int state);
96 + extern int check_options(void);
97 +--- a/criu/include/pstree.h
98 ++++ b/criu/include/pstree.h
99 +@@ -42,7 +42,7 @@ enum {
100 + };
101 + #define FDS_EVENT (1 << FDS_EVENT_BIT)
102 +
103 +-struct pstree_item *current;
104 ++extern struct pstree_item *current;
105 +
106 + struct rst_info;
107 + /* See alloc_pstree_item() for details */
108 +--- a/criu/include/tun.h
109 ++++ b/criu/include/tun.h
110 +@@ -5,7 +5,7 @@
111 + #define TUN_MINOR 200
112 + #endif
113 +
114 +-struct ns_id *ns;
115 ++extern struct ns_id *ns;
116 +
117 + #include <linux/netlink.h>
118 +