From 35c5ef1d89d81d805ac980eb1115dadb0638f3af Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 22 Aug 2022 15:38:57 -0400 Subject: [PATCH] criu: update to 3.17.1. --- srcpkgs/criu/patches/ppc64-musl.patch | 48 +++++++++++++-------------- srcpkgs/criu/patches/sigev-musl.patch | 29 ++++++++++++++++ srcpkgs/criu/template | 14 ++++---- 3 files changed, 59 insertions(+), 32 deletions(-) create mode 100644 srcpkgs/criu/patches/sigev-musl.patch diff --git a/srcpkgs/criu/patches/ppc64-musl.patch b/srcpkgs/criu/patches/ppc64-musl.patch index eaf2a813f190..bf9ae07d248a 100644 --- a/srcpkgs/criu/patches/ppc64-musl.patch +++ b/srcpkgs/criu/patches/ppc64-musl.patch @@ -11,8 +11,8 @@ Get rid of some header conflicts and glibc specific things. #include #include #include -@@ -55,8 +57,8 @@ typedef struct { - #define MSR_TM_ACTIVE(x) ((((x) & MSR_TM) && ((x)&(MSR_TMA|MSR_TMS))) != 0) +@@ -55,8 +57,8 @@ + #define MSR_TM_ACTIVE(x) ((((x)&MSR_TM) && ((x) & (MSR_TMA | MSR_TMS))) != 0) typedef struct { - uint64_t fpregs[NFPREG]; @@ -22,7 +22,7 @@ Get rid of some header conflicts and glibc specific things. uint64_t vsxregs[NVSXREG]; int flags; -@@ -66,8 +68,8 @@ typedef struct { +@@ -66,8 +68,8 @@ uint64_t tfhar, texasr, tfiar; } tm_spr_regs; user_regs_struct_t regs; @@ -43,7 +43,7 @@ Get rid of some header conflicts and glibc specific things. #include #include #include -@@ -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; @@ -72,7 +72,7 @@ Get rid of some header conflicts and glibc specific things. #include #include -@@ -33,7 +32,7 @@ static UserPpc64FpstateEntry *copy_fp_regs(uint64_t *fpregs) +@@ -33,7 +32,7 @@ return NULL; 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])); if (!fpe->fpregs) { 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 */ @@ -90,46 +90,46 @@ Get rid of some header conflicts and glibc specific things. fpe->fpregs[i] = fpregs[i]; return fpe; -@@ -69,7 +68,7 @@ static UserPpc64VrstateEntry *copy_altivec_regs(__vector128 *vrregs) +@@ -69,7 +68,7 @@ user_ppc64_vrstate_entry__init(vse); /* protocol buffer store only 64bit entries and we need 128bit */ -- vse->n_vrregs = (NVRREG-1) * 2; -+ vse->n_vrregs = (ELF_NVRREG-1) * 2; +- vse->n_vrregs = (NVRREG - 1) * 2; ++ vse->n_vrregs = (ELF_NVRREG - 1) * 2; vse->vrregs = xmalloc(vse->n_vrregs * sizeof(vse->vrregs[0])); if (!vse->vrregs) { xfree(vse); -@@ -77,13 +76,13 @@ static UserPpc64VrstateEntry *copy_altivec_regs(__vector128 *vrregs) +@@ -77,13 +76,13 @@ } /* Vectors are 2*64bits entries */ -- for (i = 0; i < (NVRREG-1); i++) { -+ for (i = 0; i < (ELF_NVRREG-1); i++) { - p64 = (uint64_t*) &vrregs[i]; - vse->vrregs[i*2] = p64[0]; - vse->vrregs[i*2 + 1] = p64[1]; +- for (i = 0; i < (NVRREG - 1); i++) { ++ for (i = 0; i < (ELF_NVRREG - 1); i++) { + p64 = (uint64_t *)&vrregs[i]; + vse->vrregs[i * 2] = p64[0]; + vse->vrregs[i * 2 + 1] = p64[1]; } -- p32 = (uint32_t*) &vrregs[NVRREG-1]; -+ p32 = (uint32_t*) &vrregs[ELF_NVRREG-1]; +- p32 = (uint32_t *)&vrregs[NVRREG - 1]; ++ p32 = (uint32_t *)&vrregs[ELF_NVRREG - 1]; vse->vrsave = *p32; 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"); -- if (vse->n_vrregs != (NVRREG-1)*2) { -+ if (vse->n_vrregs != (ELF_NVRREG-1)*2) { +- if (vse->n_vrregs != (NVRREG - 1) * 2) { ++ if (vse->n_vrregs != (ELF_NVRREG - 1) * 2) { pr_err("Corrupted Altivec dump data\n"); 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. */ - memcpy(&v_regs->vrregs[0][0], vse->vrregs, -- sizeof(uint64_t) * 2 * (NVRREG-1)); -+ sizeof(uint64_t) * 2 * (ELF_NVRREG-1)); +- memcpy(&v_regs->vrregs[0][0], vse->vrregs, sizeof(uint64_t) * 2 * (NVRREG - 1)); ++ memcpy(&v_regs->vrregs[0][0], vse->vrregs, sizeof(uint64_t) * 2 * (ELF_NVRREG - 1)); /* vscr has been restored with the previous memcpy which copied 32 * 128bits registers + a 128bits field containing the vscr value in * the low part. diff --git a/srcpkgs/criu/patches/sigev-musl.patch b/srcpkgs/criu/patches/sigev-musl.patch new file mode 100644 index 000000000000..f0e256234485 --- /dev/null +++ b/srcpkgs/criu/patches/sigev-musl.patch @@ -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; + diff --git a/srcpkgs/criu/template b/srcpkgs/criu/template index 1807efc4a43f..1a102a36bd2f 100644 --- a/srcpkgs/criu/template +++ b/srcpkgs/criu/template @@ -1,13 +1,14 @@ # Template file for 'criu' pkgname=criu -version=3.14 -revision=4 +version=3.17.1 +revision=1 # i686 unsupported upstream: https://criu.org/32bit_tasks_C/R#Compatible_applications # ppc64 big endian not supported upstream archs="x86_64* aarch64* ppc64le* armv7l*" build_style=gnu-makefile make_use_env=compliant 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" makedepends="libcap-devel libnet-devel libnl3-devel protobuf-c-devel protobuf-devel" @@ -15,14 +16,11 @@ short_desc="Utility to checkpoint/restore a process tree" maintainer="Enno Boland " license="GPL-2.0-or-later, LGPL-2.1-only" homepage="http://criu.org/" -distfiles="https://download.openvz.org/criu/criu-${version}.tar.bz2" -checksum=f63f30188b84e9a611429f732381f27e37c60cde0afc9821600f8597d21e39cb +distfiles="https://github.com/checkpoint-restore/criu/archive/refs/tags/v${version}.tar.gz" +checksum=f90fe2323ed1b84f273dc41dde1a38dd424157a57f713d1ba39094e70f90eca6 nocross="fails to run protobuf internals" -do_install() { - make DESTDIR=${DESTDIR} PREFIX=/usr LOGROTATEDIR=/etc/logrotate.d \ - LIBDIR=/usr/lib SBINDIR=/usr/bin install - rm -rf ${DESTDIR}/usr/lib/systemd +post_install() { vsv criu }