diff --git a/17271599cc8328c0d4418daaed1caebd123e425e.patch b/17271599cc8328c0d4418daaed1caebd123e425e.patch new file mode 100644 index 0000000..37ab803 --- /dev/null +++ b/17271599cc8328c0d4418daaed1caebd123e425e.patch @@ -0,0 +1,81 @@ +From 17271599cc8328c0d4418daaed1caebd123e425e Mon Sep 17 00:00:00 2001 +From: Jeff Law +Date: Wed, 9 Jan 2019 12:49:11 +0000 +Subject: [PATCH] Fix gcc9 build failures + +I received this patch from Jeff Law as a fix for build failures with the +upcoming GCC 9. The following is Jeff Law's description of the patch: + + Attached you'll find the fix for criu. You'll see it's just a matter + of dropping the sp/esp clobber from the relevant asm statements. THe + details: + + criu has a macro which defines an asm which appears to want to set a new + stack pointer, then directly issue a sigreturn call to the kernel. Some + variants clobber sp (aarch64, arm, x86), others do not (ppc, s390) + + While the asm does indeed set a new stack pointer, we never return from + a sigreturn syscall -- at least not in the normal way. We actually + return back to the point where the process was interrupted by the + signal. So describing the affect of the asm on the stack pointer is + pedantically correct, it actually has no real effect and can just be + dropped to avoid the hard error from gcc-9. + +Suggested-by: Jeff Law +Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> +Signed-off-by: Adrian Reber +Signed-off-by: Andrei Vagin +--- + compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h | 2 +- + compel/arch/arm/src/lib/include/uapi/asm/sigframe.h | 2 +- + compel/arch/x86/src/lib/include/uapi/asm/sigframe.h | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h b/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h +index 6b511ce0c5..6b9317b040 100644 +--- a/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h ++++ b/compel/arch/aarch64/src/lib/include/uapi/asm/sigframe.h +@@ -39,7 +39,7 @@ struct rt_sigframe { + "svc #0 \n" \ + : \ + : "r"(new_sp) \ +- : "sp", "x8", "memory") ++ : "x8", "memory") + + /* cr_sigcontext is copied from arch/arm64/include/uapi/asm/sigcontext.h */ + struct cr_sigcontext { +diff --git a/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h b/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h +index 3e7bc01049..b90c0f6590 100644 +--- a/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h ++++ b/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h +@@ -73,7 +73,7 @@ struct rt_sigframe { + "svc #0 \n" \ + : \ + : "r"(new_sp) \ +- : "sp","memory") ++ : "memory") + + #define RT_SIGFRAME_UC(rt_sigframe) (&rt_sigframe->sig.uc) + #define RT_SIGFRAME_REGIP(rt_sigframe) (rt_sigframe)->sig.uc.uc_mcontext.arm_ip +diff --git a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h +index 0ad45a539b..c29de3bd58 100644 +--- a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h ++++ b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h +@@ -162,7 +162,7 @@ struct rt_sigframe { + "syscall \n" \ + : \ + : "r"(new_sp) \ +- : "rax","rsp","memory") ++ : "rax","memory") + #define ARCH_RT_SIGRETURN_COMPAT(new_sp) \ + asm volatile( \ + "pushq $"__stringify(USER32_CS)" \n" \ +@@ -176,7 +176,7 @@ struct rt_sigframe { + ".code64 \n" \ + : \ + : "rdi"(new_sp) \ +- : "eax","esp", "r8", "r9", "r10", "r11", "memory") ++ : "eax", "r8", "r9", "r10", "r11", "memory") + + #define ARCH_RT_SIGRETURN(new_sp, rt_sigframe) \ + do { \ diff --git a/criu.spec b/criu.spec index 556c042..851dee1 100644 --- a/criu.spec +++ b/criu.spec @@ -12,7 +12,7 @@ Name: criu Version: 3.11 -Release: 1%{?dist} +Release: 2%{?dist} Provides: crtools = %{version}-%{release} Obsoletes: crtools <= 1.0-2 Summary: Tool for Checkpoint/Restore in User-space @@ -20,6 +20,7 @@ Group: System Environment/Base License: GPLv2 URL: http://criu.org/ Source0: http://download.openvz.org/criu/criu-%{version}.tar.bz2 +Patch0: https://github.com/checkpoint-restore/criu/commit/17271599cc8328c0d4418daaed1caebd123e425e.patch %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: perl @@ -91,6 +92,7 @@ their content in human-readable form. %prep %setup -q +%patch0 -p1 %if 0%{?rhel} && 0%{?rhel} <= 7 %patch100 -p1 @@ -164,6 +166,9 @@ rm -rf $RPM_BUILD_ROOT%{_libexecdir}/%{name} %changelog +* Sat Jan 19 2019 Adrian Reber - 3.11-2 +- Added patch for gcc-9 + * Tue Nov 06 2018 Adrian Reber - 3.11-1 - Updated to 3.11 - Removed upstreamed patches