criu: update to 3.17.1.

This commit is contained in:
classabbyamp 2022-08-22 15:38:57 -04:00 committed by classabbyamp
parent 9b88f1b935
commit d8277dc07d
3 changed files with 59 additions and 32 deletions

View file

@ -11,8 +11,8 @@ Get rid of some header conflicts and glibc specific things.
#include <stdbool.h> #include <stdbool.h>
#include <signal.h> #include <signal.h>
#include <stdint.h> #include <stdint.h>
@@ -55,8 +57,8 @@ typedef struct { @@ -55,8 +57,8 @@
#define MSR_TM_ACTIVE(x) ((((x) & MSR_TM) && ((x)&(MSR_TMA|MSR_TMS))) != 0) #define MSR_TM_ACTIVE(x) ((((x)&MSR_TM) && ((x) & (MSR_TMA | MSR_TMS))) != 0)
typedef struct { typedef struct {
- uint64_t fpregs[NFPREG]; - uint64_t fpregs[NFPREG];
@ -22,7 +22,7 @@ Get rid of some header conflicts and glibc specific things.
uint64_t vsxregs[NVSXREG]; uint64_t vsxregs[NVSXREG];
int flags; int flags;
@@ -66,8 +68,8 @@ typedef struct { @@ -66,8 +68,8 @@
uint64_t tfhar, texasr, tfiar; uint64_t tfhar, texasr, tfiar;
} tm_spr_regs; } tm_spr_regs;
user_regs_struct_t regs; user_regs_struct_t regs;
@ -43,7 +43,7 @@ Get rid of some header conflicts and glibc specific things.
#include <sys/mman.h> #include <sys/mman.h>
#include <stdint.h> #include <stdint.h>
#include <errno.h> #include <errno.h>
@@ -57,15 +56,15 @@ static void put_fpu_regs(mcontext_t *mc, uint64_t *fpregs) @@ -57,15 +56,15 @@
{ {
uint64_t *mcfp = (uint64_t *)mc->fp_regs; uint64_t *mcfp = (uint64_t *)mc->fp_regs;
@ -72,7 +72,7 @@ Get rid of some header conflicts and glibc specific things.
#include <asm/unistd.h> #include <asm/unistd.h>
#include <sys/uio.h> #include <sys/uio.h>
@@ -33,7 +32,7 @@ static UserPpc64FpstateEntry *copy_fp_regs(uint64_t *fpregs) @@ -33,7 +32,7 @@
return NULL; return NULL;
user_ppc64_fpstate_entry__init(fpe); user_ppc64_fpstate_entry__init(fpe);
@ -81,7 +81,7 @@ Get rid of some header conflicts and glibc specific things.
fpe->fpregs = xmalloc(fpe->n_fpregs * sizeof(fpe->fpregs[0])); fpe->fpregs = xmalloc(fpe->n_fpregs * sizeof(fpe->fpregs[0]));
if (!fpe->fpregs) { if (!fpe->fpregs) {
xfree(fpe); xfree(fpe);
@@ -41,7 +40,7 @@ static UserPpc64FpstateEntry *copy_fp_regs(uint64_t *fpregs) @@ -41,7 +40,7 @@
} }
/* FPSRC is the last (33th) register in the set */ /* FPSRC is the last (33th) register in the set */
@ -90,46 +90,46 @@ Get rid of some header conflicts and glibc specific things.
fpe->fpregs[i] = fpregs[i]; fpe->fpregs[i] = fpregs[i];
return fpe; return fpe;
@@ -69,7 +68,7 @@ static UserPpc64VrstateEntry *copy_altivec_regs(__vector128 *vrregs) @@ -69,7 +68,7 @@
user_ppc64_vrstate_entry__init(vse); user_ppc64_vrstate_entry__init(vse);
/* protocol buffer store only 64bit entries and we need 128bit */ /* protocol buffer store only 64bit entries and we need 128bit */
- vse->n_vrregs = (NVRREG-1) * 2; - vse->n_vrregs = (NVRREG - 1) * 2;
+ vse->n_vrregs = (ELF_NVRREG-1) * 2; + vse->n_vrregs = (ELF_NVRREG - 1) * 2;
vse->vrregs = xmalloc(vse->n_vrregs * sizeof(vse->vrregs[0])); vse->vrregs = xmalloc(vse->n_vrregs * sizeof(vse->vrregs[0]));
if (!vse->vrregs) { if (!vse->vrregs) {
xfree(vse); xfree(vse);
@@ -77,13 +76,13 @@ static UserPpc64VrstateEntry *copy_altivec_regs(__vector128 *vrregs) @@ -77,13 +76,13 @@
} }
/* Vectors are 2*64bits entries */ /* Vectors are 2*64bits entries */
- for (i = 0; i < (NVRREG-1); i++) { - for (i = 0; i < (NVRREG - 1); i++) {
+ for (i = 0; i < (ELF_NVRREG-1); i++) { + for (i = 0; i < (ELF_NVRREG - 1); i++) {
p64 = (uint64_t*) &vrregs[i]; p64 = (uint64_t *)&vrregs[i];
vse->vrregs[i*2] = p64[0]; vse->vrregs[i * 2] = p64[0];
vse->vrregs[i*2 + 1] = p64[1]; vse->vrregs[i * 2 + 1] = p64[1];
} }
- p32 = (uint32_t*) &vrregs[NVRREG-1]; - p32 = (uint32_t *)&vrregs[NVRREG - 1];
+ p32 = (uint32_t*) &vrregs[ELF_NVRREG-1]; + p32 = (uint32_t *)&vrregs[ELF_NVRREG - 1];
vse->vrsave = *p32; vse->vrsave = *p32;
return vse; return vse;
@@ -95,7 +94,7 @@ static int put_altivec_regs(mcontext_t *mc, UserPpc64VrstateEntry *vse) @@ -95,7 +94,7 @@
pr_debug("Restoring Altivec registers\n"); pr_debug("Restoring Altivec registers\n");
- if (vse->n_vrregs != (NVRREG-1)*2) { - if (vse->n_vrregs != (NVRREG - 1) * 2) {
+ if (vse->n_vrregs != (ELF_NVRREG-1)*2) { + if (vse->n_vrregs != (ELF_NVRREG - 1) * 2) {
pr_err("Corrupted Altivec dump data\n"); pr_err("Corrupted Altivec dump data\n");
return -1; return -1;
} }
@@ -104,7 +103,7 @@ static int put_altivec_regs(mcontext_t *mc, UserPpc64VrstateEntry *vse) @@ -103,7 +102,7 @@
/* Note that this should only be done in the case MSR_VEC is set but
* this is not a big deal to do that in all cases. * this is not a big deal to do that in all cases.
*/ */
memcpy(&v_regs->vrregs[0][0], vse->vrregs, - memcpy(&v_regs->vrregs[0][0], vse->vrregs, sizeof(uint64_t) * 2 * (NVRREG - 1));
- sizeof(uint64_t) * 2 * (NVRREG-1)); + memcpy(&v_regs->vrregs[0][0], vse->vrregs, sizeof(uint64_t) * 2 * (ELF_NVRREG - 1));
+ sizeof(uint64_t) * 2 * (ELF_NVRREG-1));
/* vscr has been restored with the previous memcpy which copied 32 /* vscr has been restored with the previous memcpy which copied 32
* 128bits registers + a 128bits field containing the vscr value in * 128bits registers + a 128bits field containing the vscr value in
* the low part. * the low part.

View file

@ -0,0 +1,29 @@
--- /dev/null
+++ b/include/signal_compat.h
@@ -0,0 +1,4 @@
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+#define SIGEV_THREAD_ID 4 /* deliver to thread */
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -50,6 +50,10 @@
#include "shmem.h"
#include "restorer.h"
+#ifndef __GLIBC__
+#include "signal_compat.h"
+#endif
+
#ifndef PR_SET_PDEATHSIG
#define PR_SET_PDEATHSIG 1
#endif
@@ -1067,7 +1071,7 @@
#ifdef __GLIBC__
sev._sigev_un._tid = args->posix_timers[i].spt.notify_thread_id;
#else
- sev.sigev_notify_thread_id = args->posix_timers[i].spt.notify_thread_id;
+ sev.sigev_notify_function = args->posix_timers[i].spt.notify_thread_id;
#endif
sev.sigev_value.sival_ptr = args->posix_timers[i].spt.sival_ptr;

View file

@ -1,13 +1,14 @@
# Template file for 'criu' # Template file for 'criu'
pkgname=criu pkgname=criu
version=3.14 version=3.17.1
revision=4 revision=1
# i686 unsupported upstream: https://criu.org/32bit_tasks_C/R#Compatible_applications # i686 unsupported upstream: https://criu.org/32bit_tasks_C/R#Compatible_applications
# ppc64 big endian not supported upstream # ppc64 big endian not supported upstream
archs="x86_64* aarch64* ppc64le* armv7l*" archs="x86_64* aarch64* ppc64le* armv7l*"
build_style=gnu-makefile build_style=gnu-makefile
make_use_env=compliant make_use_env=compliant
make_build_args="WERROR=0" make_build_args="WERROR=0"
make_install_args="LOGROTATEDIR=/etc/logrotate.d LIBDIR=/usr/lib SBINDIR=/usr/bin"
hostmakedepends="asciidoc pkg-config xmlto protobuf which" hostmakedepends="asciidoc pkg-config xmlto protobuf which"
makedepends="libcap-devel libnet-devel libnl3-devel protobuf-c-devel makedepends="libcap-devel libnet-devel libnl3-devel protobuf-c-devel
protobuf-devel" protobuf-devel"
@ -15,14 +16,11 @@ short_desc="Utility to checkpoint/restore a process tree"
maintainer="Enno Boland <gottox@voidlinux.org>" maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-only" license="GPL-2.0-or-later, LGPL-2.1-only"
homepage="http://criu.org/" homepage="http://criu.org/"
distfiles="https://download.openvz.org/criu/criu-${version}.tar.bz2" distfiles="https://github.com/checkpoint-restore/criu/archive/refs/tags/v${version}.tar.gz"
checksum=f63f30188b84e9a611429f732381f27e37c60cde0afc9821600f8597d21e39cb checksum=f90fe2323ed1b84f273dc41dde1a38dd424157a57f713d1ba39094e70f90eca6
nocross="fails to run protobuf internals" nocross="fails to run protobuf internals"
do_install() { post_install() {
make DESTDIR=${DESTDIR} PREFIX=/usr LOGROTATEDIR=/etc/logrotate.d \
LIBDIR=/usr/lib SBINDIR=/usr/bin install
rm -rf ${DESTDIR}/usr/lib/systemd
vsv criu vsv criu
} }