summaryrefslogtreecommitdiff
path: root/sys-process/criu
diff options
context:
space:
mode:
Diffstat (limited to 'sys-process/criu')
-rw-r--r--sys-process/criu/Manifest3
-rw-r--r--sys-process/criu/criu-3.17-r1.ebuild1
-rw-r--r--sys-process/criu/files/criu-3.17-glibc-2.36.patch242
3 files changed, 245 insertions, 1 deletions
diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 2c48ee88445a..e0912d7d3f63 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -5,6 +5,7 @@ AUX criu-3.15-pkg-config.patch 5131 BLAKE2B 3b4cc0a2ae3dac24eb5f76a20478844e10b6
AUX criu-3.15-protobuf-c-1.4.0.patch 6377 BLAKE2B bbfce0a7feecf2886cb5fbfff3d79ac47e28e1cd6d5d5133323c5d89be005120e38de5378f31faaf83f0698170ca4b8d5d795faaca190802d2102539032b193a SHA512 50f1e6a5cb2b69d0fbbbe1013d4d2b91af6800dfcfc2d73d83cd389118ab85dea1d2b32fb4152b56ef58373da3e8cd6e962f9c111359e6e76e399c3e84f3030e
AUX criu-3.16.1-buildsystem.patch 2164 BLAKE2B aaa5e47ca5c822407693c795015e25b9db5208bf0c25026030c5b776769d27c4513707865fdd37eb4acd14beca4eecdcb83fe77c6c9479df2519dc0c49e912b5 SHA512 a36932081ed1aa058a60f93ec4a2c434a3ec6cad6ac221f2db22f3d01025e7de074ef3f3feda206ed50b1ed921b87cfa5e3d07e6cfc50ab1c527a2821ad33e1d
AUX criu-3.17-amdgpu-build-fixes.patch 3069 BLAKE2B 21bf7ce7bfa8a1d07e2160a7dd8b6e4d638499add115d66b40811d095f622cdf93f51aaacf16afb48bcc8cd0084839982ebe3e9c3c149d8303f12468959c0d00 SHA512 9c4d94d937ce4802531456d2a1679dcaa7f726fc96d80b0892b3c17ae6653ae94090f1f23f8c9ae6450782d74f5de05151b277aef826349cfc510c70e459c2ca
+AUX criu-3.17-glibc-2.36.patch 7344 BLAKE2B 4b42e4b524807fed9277eaafbbe9c77bc4dd6e0993d8f801898e2c2a3d4c0aca58d58e34285f23a7d5f1778f8f952f27c7b6a323313103b6444d07287431d9b8 SHA512 d7e6768c26a0f27e11f639d17ccdb62ba7543cbcfdc7a940e39c0ad4f338dce9996129c41904df667633282fb954ec79ffe88879dc61a39658ed7c821fa8f1ba
DIST criu-3.14.tar.bz2 881407 BLAKE2B 418412681baf7ec9d3a03afe3860590c857bffcb6c57d01e60b77e85dd5ba2b30deee280c884ba1574665be5fcfd03f3cc058a4b7ae08f66aabe63a80373089b SHA512 97d064c5ffc41daf6e89edd6208b30e4198f313afc6d621d0dc74dadf94c303be70ba448d4e1ced9500f1c65f1bd12206eb88883be398911cc2c995310b17cc6
DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
DIST criu-3.16.1.tar.gz 1228535 BLAKE2B 45aa87ee00a18b91474e767dc0326cce6c0942af7771a0c5536751361c171c86ba2065c54587e82b51fd6d7ab116e659324369955086c5237cd7fd26b60d6ce6 SHA512 a558af41f1927a1b1d87f8d11163a5f3d2e4f83a74aba00619b45a6d464d5477a6a0aac3c1b9d9a17e3343a4bf21a3fd6b279b51fa0c347c86c307381a4d0739
@@ -13,5 +14,5 @@ EBUILD criu-3.14-r2.ebuild 3196 BLAKE2B 27115869838fc33eb2d97c2d79e190e43e8a5550
EBUILD criu-3.15-r3.ebuild 3305 BLAKE2B 9e0e7f1d60b25433d6169f685d7fac59473689c6c62dc66e0a0916df0bc3bfbfce4527199f7941e95e96bdc8aacf44b2de9a661d699f26daf5e50d33e8cef418 SHA512 0cd8eb9044f7cd8392ad10fea98ef0cefa29d2244fe062c067ae8b01d97b5b73ace6c205679ccd9c2970d120e08879c652cb74c7c20fdec2b6886d5d7e50ccb4
EBUILD criu-3.15.ebuild 3238 BLAKE2B c574df329b38459491173e3b460d624709b94a23afc08dba6c2516261c96cd2c0b07a8d45c7ae512da4a15b515d3c067db6a61e84eca4152d8306f68605f3792 SHA512 8904ba6f2b5631f5dbf7b14de2842ab3d309354a1249a3197b39c11c1ef17703176f61ef24a0898f44eb3e1f5401b1dc475f3fd92e602ce4bb0a86c5b511031a
EBUILD criu-3.16.1.ebuild 3556 BLAKE2B a9278ecf42da4037e13f7c9243162c5d85289122002424e4629d740869ab9c177dd9574f8ae33a2071e7b2f7ad53ae594411aa484bcc6fe1987a2e8c222ecede SHA512 778f4937a6d5c1f065528757fc04a274fe9567938a8d086874839fb9fd8d97d8d14dab6747b7e98e417b6d1aa8cd7b17112e193ee93326cc19b742b72bb8aaa5
-EBUILD criu-3.17-r1.ebuild 3721 BLAKE2B 1c85aa11194db2025670af8062a1192ae125d633945c56231734ea572fef8f43743fbfa5b7918fe50a1539676b3cf19913da94fdbf69729e587461f22214dec9 SHA512 157e09261a05454f99b47f2451078c3c8bcf6607366b56a94cc9db89b3d2c0e69c3ee378f6ac203d49178b65d237f33b9f0ce830732dffcda4a1e2d7e1093cbd
+EBUILD criu-3.17-r1.ebuild 3764 BLAKE2B f5ac18ecfed2f4441cbaa9994d69f0904232a2abd9824162218c4688e3a99403c6d5e3420e61d5d00784646d12b37905338b7f5912ff295f58cd4c9f0cc80040 SHA512 728a0c7d3ac0e635309125a4376fb3892f7f246041809bb15f64e8b274689141448ea9372901dcf7930068d51e4d4326c055e63b958538bdc5a278b56da9e0a9
MISC metadata.xml 690 BLAKE2B d39aa87ec4e0470cb5864776d802cc06be21866123a8db69ace61af3f686cf9b034cf6790d2a5fd5777bb02531db78ea72eb03c0f3f18195b56ea4b85205c87e SHA512 385296a53d274252d796563346bd999dbe4afa5c02b5f00ce42459ad995ce004f593a039c54f1e91fb572b849199e2669077ffda3affd031e23f4b4d1db9ff0e
diff --git a/sys-process/criu/criu-3.17-r1.ebuild b/sys-process/criu/criu-3.17-r1.ebuild
index 66993d5ce406..ac5e1722d999 100644
--- a/sys-process/criu/criu-3.17-r1.ebuild
+++ b/sys-process/criu/criu-3.17-r1.ebuild
@@ -60,6 +60,7 @@ PATCHES=(
"${FILESDIR}/criu-3.16.1-buildsystem.patch"
"${FILESDIR}/${P}-amdgpu-build-fixes.patch"
+ "${FILESDIR}/${PN}-3.17-glibc-2.36.patch"
)
criu_arch() {
diff --git a/sys-process/criu/files/criu-3.17-glibc-2.36.patch b/sys-process/criu/files/criu-3.17-glibc-2.36.patch
new file mode 100644
index 000000000000..5387c5a5b97c
--- /dev/null
+++ b/sys-process/criu/files/criu-3.17-glibc-2.36.patch
@@ -0,0 +1,242 @@
+https://bugs.gentoo.org/863683
+https://github.com/checkpoint-restore/criu/pull/1943
+
+From 8cd5fccd6cf3d03afb5abe463134d31f54d42258 Mon Sep 17 00:00:00 2001
+From: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+Date: Sun, 31 Jul 2022 16:07:30 +0000
+Subject: [PATCH 2/2] criu: fix conflicting headers
+
+There are several changes in glibc 2.36 that make sys/mount.h header
+incompatible with kernel headers:
+
+https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+
+This patch removes conflicting includes for `<linux/mount.h>` and
+updates the content of `criu/include/linux/mount.h` to match
+`/usr/include/sys/mount.h`. In addition, inline definitions sys_*()
+functions have been moved from "linux/mount.h" to "syscall.h" to
+avoid conflicts with `uapi/compel/plugins/std/syscall.h` and
+`<unistd.h>`. The include for `<linux/aio_abi.h>` has been replaced
+with local include to avoid conflicts with `<sys/mount.h>`.
+
+Fixes: #1949
+
+Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+--- a/criu/cgroup.c
++++ b/criu/cgroup.c
+@@ -27,6 +27,7 @@
+ #include "images/cgroup.pb-c.h"
+ #include "kerndat.h"
+ #include "linux/mount.h"
++#include "syscall.h"
+
+ /*
+ * This structure describes set of controller groups
+--- a/criu/cr-check.c
++++ b/criu/cr-check.c
+@@ -21,7 +21,6 @@
+ #include <sys/prctl.h>
+ #include <sched.h>
+ #include <sys/mount.h>
+-#include <linux/aio_abi.h>
+
+ #include "../soccr/soccr.h"
+
+@@ -52,6 +51,7 @@
+ #include "net.h"
+ #include "restorer.h"
+ #include "uffd.h"
++#include "linux/aio_abi.h"
+
+ #include "images/inventory.pb-c.h"
+
+--- a/criu/cr-restore.c
++++ b/criu/cr-restore.c
+@@ -22,7 +22,6 @@
+ #include <compel/ptrace.h>
+ #include "common/compiler.h"
+
+-#include "linux/mount.h"
+ #include "linux/rseq.h"
+
+ #include "clone-noasan.h"
+@@ -86,6 +85,8 @@
+ #include <compel/plugins/std/syscall-codes.h>
+ #include "compel/include/asm/syscall.h"
+
++#include "linux/mount.h"
++
+ #include "protobuf.h"
+ #include "images/sa.pb-c.h"
+ #include "images/timer.pb-c.h"
+--- a/criu/include/aio.h
++++ b/criu/include/aio.h
+@@ -1,7 +1,7 @@
+ #ifndef __CR_AIO_H__
+ #define __CR_AIO_H__
+
+-#include <linux/aio_abi.h>
++#include "linux/aio_abi.h"
+ #include "images/mm.pb-c.h"
+ unsigned int aio_estimate_nr_reqs(unsigned int size);
+ int dump_aio_ring(MmEntry *mme, struct vma_area *vma);
+--- /dev/null
++++ b/criu/include/linux/aio_abi.h
+@@ -0,0 +1,14 @@
++#ifndef __LINUX__AIO_ABI_H
++#define __LINUX__AIO_ABI_H
++
++typedef __kernel_ulong_t aio_context_t;
++
++/* read() from /dev/aio returns these structures. */
++struct io_event {
++ __u64 data; /* the data field from the iocb */
++ __u64 obj; /* what iocb this event came from */
++ __s64 res; /* result code for this event */
++ __s64 res2; /* secondary result */
++};
++
++#endif /* __LINUX__AIO_ABI_H */
+--- a/criu/include/linux/mount.h
++++ b/criu/include/linux/mount.h
+@@ -4,32 +4,34 @@
+ #include "common/config.h"
+ #include "compel/plugins/std/syscall-codes.h"
+
+-#ifdef CONFIG_HAS_FSCONFIG
+-#include <linux/mount.h>
+-#else
++/* Copied from /usr/include/sys/mount.h */
++
++#ifndef FSCONFIG_CMD_CREATE
++/* The type of fsconfig call made. */
+ enum fsconfig_command {
+- FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
+- FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
+- FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */
+- FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
+- FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
+- FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
+- FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
++ FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
++#define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
++ FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
++#define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
++ FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */
++#define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
++ FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
++#define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
++ FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
++#define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
++ FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
++#define FSCONFIG_SET_FD FSCONFIG_SET_FD
++ FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
++#define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
+ FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
++#define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
+-#endif
++#endif // FSCONFIG_CMD_CREATE
+
+-static inline int sys_fsopen(const char *fsname, unsigned int flags)
+-{
+- return syscall(__NR_fsopen, fsname, flags);
+-}
+-static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux)
+-{
+- return syscall(__NR_fsconfig, fd, cmd, key, value, aux);
+-}
+-static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags)
+-{
+- return syscall(__NR_fsmount, fd, flags, attr_flags);
+-}
++#ifndef MS_MGC_VAL
++/* Magic mount flag number. Has to be or-ed to the flag values. */
++#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
++#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
++#endif
+
+ #endif
+--- /dev/null
++++ b/criu/include/syscall.h
+@@ -0,0 +1,17 @@
++#ifndef __CR_SYSCALL_H__
++#define __CR_SYSCALL_H__
++
++static inline int sys_fsopen(const char *fsname, unsigned int flags)
++{
++ return syscall(__NR_fsopen, fsname, flags);
++}
++static inline int sys_fsconfig(int fd, unsigned int cmd, const char *key, const char *value, int aux)
++{
++ return syscall(__NR_fsconfig, fd, cmd, key, value, aux);
++}
++static inline int sys_fsmount(int fd, unsigned int flags, unsigned int attr_flags)
++{
++ return syscall(__NR_fsmount, fd, flags, attr_flags);
++}
++
++#endif /* __CR_SYSCALL_H__ */
+\ No newline at end of file
+--- a/criu/pie/parasite.c
++++ b/criu/pie/parasite.c
+@@ -3,7 +3,6 @@
+ #include <signal.h>
+ #include <linux/limits.h>
+ #include <linux/capability.h>
+-#include <sys/mount.h>
+ #include <stdarg.h>
+ #include <sys/ioctl.h>
+ #include <sys/uio.h>
+@@ -14,6 +13,7 @@
+ #include "int.h"
+ #include "types.h"
+ #include <compel/plugins/std/syscall.h>
++#include "linux/mount.h"
+ #include "parasite.h"
+ #include "fcntl.h"
+ #include "prctl.h"
+--- a/criu/util.c
++++ b/criu/util.c
+@@ -40,6 +40,7 @@
+ #include "mem.h"
+ #include "namespaces.h"
+ #include "criu-log.h"
++#include "syscall.h"
+
+ #include "clone-noasan.h"
+ #include "cr_options.h"
+--- a/scripts/feature-tests.mak
++++ b/scripts/feature-tests.mak
+@@ -137,19 +137,6 @@ ENTRY(main)
+ END(main)
+ endef
+
+-define FEATURE_TEST_FSCONFIG
+-
+-#include <linux/mount.h>
+-
+-int main(void)
+-{
+- if (FSCONFIG_CMD_CREATE > 0)
+- return 0;
+- return 0;
+-}
+-
+-endef
+-
+ define FEATURE_TEST_NFTABLES_LIB_API_0
+
+ #include <string.h>
+
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -70,7 +70,7 @@ export DEFINES += $(FEATURE_DEFINES)
+ export CFLAGS += $(FEATURE_DEFINES)
+
+ FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \
+- SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW FSCONFIG MEMFD_CREATE OPENAT2
++ SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW MEMFD_CREATE OPENAT2
+
+ # $1 - config name
+ define gen-feature-test