diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2020-08-31 23:08:05 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-09-02 16:30:44 -0400 |
commit | 2711b81afd489d5b458617dfdfda520d8fe61f65 (patch) | |
tree | 7979b0b5efe642c3a9077303b66c7eff1987a72b | |
parent | 4d7eadcf5b9aa19f627698262f2910d1ccde4e99 (diff) | |
download | meta-virtualization-2711b81afd489d5b458617dfdfda520d8fe61f65.tar.gz |
criu: backport patch to fix build failure for gcc-10
Backport patch to fix build failure for gcc-10.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/criu/criu_git.bb | 1 | ||||
-rw-r--r-- | recipes-containers/criu/files/0001-criu-fix-build-failure-against-gcc-10.patch | 87 |
2 files changed, 88 insertions, 0 deletions
diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb index 704a0f9e..24aa3012 100644 --- a/recipes-containers/criu/criu_git.bb +++ b/recipes-containers/criu/criu_git.bb | |||
@@ -21,6 +21,7 @@ SRC_URI = "git://github.com/checkpoint-restore/criu.git \ | |||
21 | file://0002-criu-Skip-documentation-install.patch \ | 21 | file://0002-criu-Skip-documentation-install.patch \ |
22 | file://0001-criu-Change-libraries-install-directory.patch \ | 22 | file://0001-criu-Change-libraries-install-directory.patch \ |
23 | file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ | 23 | file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ |
24 | file://0001-criu-fix-build-failure-against-gcc-10.patch \ | ||
24 | " | 25 | " |
25 | 26 | ||
26 | COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" | 27 | COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" |
diff --git a/recipes-containers/criu/files/0001-criu-fix-build-failure-against-gcc-10.patch b/recipes-containers/criu/files/0001-criu-fix-build-failure-against-gcc-10.patch new file mode 100644 index 00000000..f1a2561f --- /dev/null +++ b/recipes-containers/criu/files/0001-criu-fix-build-failure-against-gcc-10.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | From c6b9c083ecbd2060c7dc77a9264ef10aafa19063 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sergei Trofimovich <slyfox@gentoo.org> | ||
3 | Date: Sun, 2 Feb 2020 18:45:59 +0000 | ||
4 | Subject: [PATCH] criu: fix build failure against gcc-10 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | On gcc-10 (and gcc-9 -fno-common) build fails as: | ||
10 | |||
11 | ``` | ||
12 | ld: criu/arch/x86/crtools.o:criu/include/cr_options.h:159: | ||
13 | multiple definition of `rpc_cfg_file'; criu/arch/x86/cpu.o:criu/include/cr_options.h:159: first defined here | ||
14 | make[2]: *** [scripts/nmk/scripts/build.mk:164: criu/arch/x86/crtools.built-in.o] Error 1 | ||
15 | ``` | ||
16 | |||
17 | gcc-10 will change the default from -fcommon to fno-common: | ||
18 | https://gcc.gnu.org/PR85678. | ||
19 | |||
20 | The error also happens if CFLAGS=-fno-common passed explicitly. | ||
21 | |||
22 | Reported-by: Toralf Förster | ||
23 | Bug: https://bugs.gentoo.org/707942 | ||
24 | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> | ||
25 | |||
26 | Upstream-Status: Backport [https://github.com/checkpoint-restore/criu/pull/936] | ||
27 | |||
28 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
29 | |||
30 | --- | ||
31 | criu/config.c | 1 + | ||
32 | criu/include/cr_options.h | 2 +- | ||
33 | criu/include/pstree.h | 2 +- | ||
34 | criu/include/tun.h | 2 +- | ||
35 | 4 files changed, 4 insertions(+), 3 deletions(-) | ||
36 | |||
37 | diff --git a/criu/config.c b/criu/config.c | ||
38 | index 39aa071c..009a48a6 100644 | ||
39 | --- a/criu/config.c | ||
40 | +++ b/criu/config.c | ||
41 | @@ -30,6 +30,7 @@ | ||
42 | #include "common/xmalloc.h" | ||
43 | |||
44 | struct cr_options opts; | ||
45 | +char *rpc_cfg_file; | ||
46 | |||
47 | static int count_elements(char **to_count) | ||
48 | { | ||
49 | diff --git a/criu/include/cr_options.h b/criu/include/cr_options.h | ||
50 | index 82f76ad9..9c20aaea 100644 | ||
51 | --- a/criu/include/cr_options.h | ||
52 | +++ b/criu/include/cr_options.h | ||
53 | @@ -147,7 +147,7 @@ struct cr_options { | ||
54 | }; | ||
55 | |||
56 | extern struct cr_options opts; | ||
57 | -char *rpc_cfg_file; | ||
58 | +extern char *rpc_cfg_file; | ||
59 | |||
60 | extern int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd, int state); | ||
61 | extern int check_options(); | ||
62 | diff --git a/criu/include/pstree.h b/criu/include/pstree.h | ||
63 | index 7303c1fe..61ab0ce0 100644 | ||
64 | --- a/criu/include/pstree.h | ||
65 | +++ b/criu/include/pstree.h | ||
66 | @@ -42,7 +42,7 @@ enum { | ||
67 | }; | ||
68 | #define FDS_EVENT (1 << FDS_EVENT_BIT) | ||
69 | |||
70 | -struct pstree_item *current; | ||
71 | +extern struct pstree_item *current; | ||
72 | |||
73 | struct rst_info; | ||
74 | /* See alloc_pstree_item() for details */ | ||
75 | diff --git a/criu/include/tun.h b/criu/include/tun.h | ||
76 | index ce0b266a..b82c445a 100644 | ||
77 | --- a/criu/include/tun.h | ||
78 | +++ b/criu/include/tun.h | ||
79 | @@ -5,7 +5,7 @@ | ||
80 | #define TUN_MINOR 200 | ||
81 | #endif | ||
82 | |||
83 | -struct ns_id *ns; | ||
84 | +extern struct ns_id *ns; | ||
85 | |||
86 | #include <linux/netlink.h> | ||
87 | |||