Skip to contentSkip to conversation

criu: fix build failure with newer glibc and kernel

PATCH In review Yi Zhao 2 participants 3 messages Apr 13, 2018

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/2 criu: fix build failure with newer glibc and kernel

With newer glibc(>= 2.26) and kernel(>=4.14), criu would fail to build:

In file included from /buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/recipe-sysroot/usr/include/linux/aio_abi.h:31:0,

        from criu/cr-check.c:24:

/buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/recipe-sysroot/usr/include/sys/mount.h:35:3:
error: expected identifier before numeric constant
MS_RDONLY = 1, /* Mount read-only. */
^

  CC       criu/parasite-syscall.o
  CC       criu/pipes.o
  CC       criu/pie-util.o
  CC       criu/pie-util-vdso.o
  CC       criu/plugin.o

/buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/git/scripts/nmk/scripts/build.mk:110:
recipe for target 'criu/cr-check.o' failed
make[2]: *** [criu/cr-check.o] Error 1

Backport a patch to fix it.

---
 recipes-containers/criu/criu_git.bb                |  1 +
 .../fix-building-on-newest-glibc-and-kernel.patch  | 47 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)
 create mode 100644 recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch
recipes-containers/criu/criu_git.bb +1 -0
index 083609f..7d62f35 100644
@@ -21,6 +21,7 @@ SRC_URI = "git://github.com/xemul/criu.git;protocol=git \
            file://0002-criu-Skip-documentation-install.patch \
            file://0001-criu-Change-libraries-install-directory.patch \
            file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \
+           file://fix-building-on-newest-glibc-and-kernel.patch \
           "
 
 COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 criu: refresh patches to fix QA warning

Refresh patches with devtool command to fix do_patch warning.

---
 .../0001-criu-Change-libraries-install-directory.patch     |  8 +++-----
 .../criu/files/0001-criu-Fix-toolchain-hardcode.patch      |  6 ++----
 .../criu/files/0002-criu-Skip-documentation-install.patch  | 14 ++++++--------
 .../files/fix-building-on-newest-glibc-and-kernel.patch    |  8 +++-----
 ...-Makefile-overwrite-install-lib-to-allow-multiarc.patch |  6 ++----
 5 files changed, 16 insertions(+), 26 deletions(-)
recipes-containers/criu/files/0001-criu-Change-libraries-install-directory.patch +3 -5
index 4908e47..afb1332 100644
@@ -1,4 +1,4 @@
-From 78390305829316633acee2ca5607331b0e37a104 Mon Sep 17 00:00:00 2001
+From f64fbca70e6049dad3c404d871f2383d97725d2d Mon Sep 17 00:00:00 2001
 From: Mark Asselstine <[email protected]>
 Date: Fri, 8 Sep 2017 15:11:31 -0400
 Subject: [PATCH] criu: Change libraries install directory
@@ -7,12 +7,13 @@ Install the libraries into /usr/lib(or /usr/lib64)
 
 Signed-off-by: Jianchuan Wang <[email protected]>
 Signed-off-by: Mark Asselstine <[email protected]>
+
 ---
  Makefile.install | 13 -------------
  1 file changed, 13 deletions(-)
 
 diff --git a/Makefile.install b/Makefile.install
-index 3987bcc..73d98a4 100644
+index 1def3cf..d020eef 100644
 --- a/Makefile.install
 +++ b/Makefile.install
 @@ -9,19 +9,6 @@ LIBEXECDIR	?= $(PREFIX)/libexec
@@ -35,6 +36,3 @@ index 3987bcc..73d98a4 100644
  # LIBDIR falls back to the standard path.
  LIBDIR ?= $(PREFIX)/lib
  
--- 
-2.7.4
-
recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch +2 -4
index dc5b897..d1f136c 100644
@@ -1,4 +1,4 @@
-From af679853a45fe63f680c99e70416c8ac620d23b8 Mon Sep 17 00:00:00 2001
+From c005b7a4874f55df687ff22bc425551775581421 Mon Sep 17 00:00:00 2001
 From: Mark Asselstine <[email protected]>
 Date: Fri, 8 Sep 2017 15:02:14 -0400
 Subject: [PATCH] criu: Fix toolchain hardcode
@@ -9,6 +9,7 @@ be taken.
 Signed-off-by: Yang Shi <[email protected]>
 Signed-off-by: Jianchuan Wang <[email protected]>
 Signed-off-by: Mark Asselstine <[email protected]>
+
 ---
  Makefile                       |  2 +-
  scripts/nmk/scripts/include.mk |  2 +-
@@ -96,6 +97,3 @@ index 56dba84..1698821 100644
  
  export RM HOSTLD LD HOSTCC CC CPP AS AR STRIP OBJCOPY OBJDUMP
  export NM SH MAKE MKDIR AWK PERL PYTHON SH CSCOPE
--- 
-2.7.4
-
recipes-containers/criu/files/0002-criu-Skip-documentation-install.patch +6 -8
index ba414d9..af45db7 100644
@@ -1,21 +1,22 @@
-From 07d9b3d0c372e45127dd51781d9564e8bee90dbe Mon Sep 17 00:00:00 2001
+From 45d74ae8a314c481398ba91a3697ffbd074cd98b Mon Sep 17 00:00:00 2001
 From: Jianchuan Wang <[email protected]>
 Date: Tue, 16 Aug 2016 09:42:24 +0800
-Subject: [PATCH 2/2] criu: Skip documentation install
+Subject: [PATCH] criu: Skip documentation install
 
 asciidoc is needed to generate CRIU documentation, so skip it in install.
 
 Signed-off-by: Jianchuan Wang <[email protected]>
+
 ---
  Makefile.install | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile.install b/Makefile.install
-index a30dc96..33143fb 100644
+index 3987bcc..1def3cf 100644
 --- a/Makefile.install
 +++ b/Makefile.install
-@@ -22,7 +22,7 @@ install-tree:
- .PHONY: install-tree
+@@ -29,7 +29,7 @@ export PREFIX BINDIR SBINDIR MANDIR RUNDIR
+ export LIBDIR INCLUDEDIR LIBEXECDIR
  
  install-man:
 -	$(Q) $(MAKE) -C Documentation install
@@ -23,6 +24,3 @@ index a30dc96..33143fb 100644
  .PHONY: install-man
  
  install-lib: lib
--- 
-2.7.4
-
recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch +3 -5
index d6341da..9361adc 100644
@@ -1,4 +1,4 @@
-From f41e386d4d40e3e26b0cfdc85a812b7edb337f1d Mon Sep 17 00:00:00 2001
+From b59947007362b53e9f41f1e5a33071dedf1c59ac Mon Sep 17 00:00:00 2001
 From: Adrian Reber <[email protected]>
 Date: Thu, 28 Sep 2017 09:13:33 +0000
 Subject: [PATCH] fix building on newest glibc and kernel
@@ -24,12 +24,13 @@ Upstream-Status: Backport
 [https://github.com/checkpoint-restore/criu/commit/f41e386d4d40e3e26b0cfdc85a812b7edb337f1d#diff-cc847b1cc975358c6582595be92d48db]
 
 Signed-off-by: Yi Zhao <[email protected]>
+
 ---
  criu/cr-check.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/criu/cr-check.c b/criu/cr-check.c
-index 5dd448b..8986ec4 100644
+index 1dd887a..93df2ab 100644
 --- a/criu/cr-check.c
 +++ b/criu/cr-check.c
 @@ -21,8 +21,8 @@
@@ -42,6 +43,3 @@ index 5dd448b..8986ec4 100644
  
  #include "../soccr/soccr.h"
  
--- 
-2.7.4
-
recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch +2 -4
index c2512a0..59e7bcb 100644
@@ -1,4 +1,4 @@
-From 89f9b87904bd312b817ffaa7d83abfd5e84d723d Mon Sep 17 00:00:00 2001
+From 6caf90592d61c8c45b32cb7ff76709f9326030e2 Mon Sep 17 00:00:00 2001
 From: Mark Asselstine <[email protected]>
 Date: Fri, 8 Sep 2017 15:40:49 -0400
 Subject: [PATCH] lib/Makefile: overwrite install-lib, to allow multiarch
@@ -8,6 +8,7 @@ I am not sure why Yocto installs python modules in arch specific
 INSTALL_LIB.
 
 Signed-off-by: Mark Asselstine <[email protected]>
+
 ---
  lib/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
@@ -25,6 +26,3 @@ index b1bb057..06f5c5d 100644
  .PHONY: install
  
  uninstall:
--- 
-2.7.4
-
Signature · 1 line
2.7.4
#2 lore raw
In reply to Yi Zhao

merged

Bruce

Quoted 93 lines · Yi Zhao

With newer glibc(>= 2.26) and kernel(>=4.14), criu would fail to build:

In file included from /buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/recipe-sysroot/usr/include/linux/aio_abi.h:31:0,

         from criu/cr-check.c:24:
/buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/recipe-sysroot/usr/include/sys/mount.h:35:3:
error: expected identifier before numeric constant
    MS_RDONLY = 1,  /* Mount read-only.  */
    ^
   CC       criu/parasite-syscall.o
   CC       criu/pipes.o
   CC       criu/pie-util.o
   CC       criu/pie-util-vdso.o
   CC       criu/plugin.o

/buildarea/build/tmp/work/core2-64-poky-linux/criu/3.4+gitAUTOINC+a31c1854e1-r0/git/scripts/nmk/scripts/build.mk:110:
recipe for target 'criu/cr-check.o' failed
make[2]: *** [criu/cr-check.o] Error 1

Backport a patch to fix it.

---
  recipes-containers/criu/criu_git.bb                |  1 +
  .../fix-building-on-newest-glibc-and-kernel.patch  | 47 ++++++++++++++++++++++
  2 files changed, 48 insertions(+)

create mode 100644 recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch

recipes-containers/criu/criu_git.bb +1 -0
index 083609f..7d62f35 100644
@@ -21,6 +21,7 @@ SRC_URI = "git://github.com/xemul/criu.git;protocol=git \
             file://0002-criu-Skip-documentation-install.patch \
             file://0001-criu-Change-libraries-install-directory.patch \
             file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \
+           file://fix-building-on-newest-glibc-and-kernel.patch \
            "
 
  COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
recipes-containers/criu/files/fix-building-on-newest-glibc-and-kernel.patch new file +47 -0
new file mode 100644
index 0000000..d6341da
@@ -0,0 +1,47 @@
+From f41e386d4d40e3e26b0cfdc85a812b7edb337f1d Mon Sep 17 00:00:00 2001
+From: Adrian Reber <[email protected]>
+Date: Thu, 28 Sep 2017 09:13:33 +0000
+Subject: [PATCH] fix building on newest glibc and kernel
+
+On Fedora rawhide with kernel-headers-4.14.0-0.rc2.git0.1.fc28.x86_64
+glibc-devel-2.26.90-15.fc28.x86_64 criu does not build any more:
+
+In file included from /usr/include/linux/aio_abi.h:31:0,
+                 from criu/cr-check.c:24:
+/usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant
+   MS_RDONLY = 1,  /* Mount read-only.  */
+   ^
+make[2]: *** [/builddir/build/BUILD/criu-3.5/scripts/nmk/scripts/build.mk:111: criu/cr-check.o] Error 1
+make[1]: *** [criu/Makefile:73: criu/built-in.o] Error 2
+make: *** [Makefile:233: criu] Error 2
+
+This simple re-ordering of includes fixes it for me.
+
+Signed-off-by: Adrian Reber <[email protected]>
+Signed-off-by: Andrei Vagin <[email protected]>
+
+Upstream-Status: Backport
+[https://github.com/checkpoint-restore/criu/commit/f41e386d4d40e3e26b0cfdc85a812b7edb337f1d#diff-cc847b1cc975358c6582595be92d48db]
+
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ criu/cr-check.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/criu/cr-check.c b/criu/cr-check.c
+index 5dd448b..8986ec4 100644
+--- a/criu/cr-check.c
++++ b/criu/cr-check.c
+@@ -21,8 +21,8 @@
+ #include <netinet/in.h>
+ #include <sys/prctl.h>
+ #include <sched.h>
+-#include <linux/aio_abi.h>
+ #include <sys/mount.h>
++#include <linux/aio_abi.h>
+
+ #include "../soccr/soccr.h"
+
+--
+2.7.4
+