diff --git a/0075-compel-fix-parasite-with-GCC-12.patch b/0075-compel-fix-parasite-with-GCC-12.patch new file mode 100644 index 0000000000000000000000000000000000000000..48a1b231f9e957bcbe6a7f406b5e0c60306090cd --- /dev/null +++ b/0075-compel-fix-parasite-with-GCC-12.patch @@ -0,0 +1,43 @@ +From 0568889ee368c2bc2682aae5c69d67ac16eac675 Mon Sep 17 00:00:00 2001 +From: Adrian Reber +Date: Tue, 18 Jan 2022 17:22:46 +0000 +Subject: [PATCH] compel: fix parasite with GCC 12 + +Parasite creation started to fail with GCC 12: + +On x86_64 with: + ./compel/compel-host hgen -f criu/pie/restorer.built-in.o -o criu/pie/restorer-blob.h + Error (compel/src/lib/handle-elf-host.c:337): Unexpected undefined symbol: `strlen'. External symbol in PIE? + +On aarch64 with: + ld: criu/pie/restorer.o: in function `lsm_set_label': + /drone/src/criu/pie/restorer.c:174: undefined reference to `strlen' + +Line 174 is: "for (len = 0; label[len]; len++)" + +Adding '-ffreestanding' to parasite compilation fixes these errors +because, according to GCC developers: + +"strlen is a standard C function, so I don't see any bug in that being used +unless you do a freestanding compilation (-nostdlib isn't that)." + +Signed-off-by: Adrian Reber +--- + compel/src/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compel/src/main.c b/compel/src/main.c +index a9a50959f..f461ff04d 100644 +--- a/compel/src/main.c ++++ b/compel/src/main.c +@@ -19,6 +19,7 @@ + + #define CFLAGS_DEFAULT_SET \ + "-Wstrict-prototypes " \ ++ "-ffreestanding " \ + "-fno-stack-protector -nostdlib -fomit-frame-pointer " + + #define COMPEL_CFLAGS_PIE CFLAGS_DEFAULT_SET "-fpie" +-- +2.33.0 + diff --git a/criu.spec b/criu.spec index e388b0726c7948637a5e3b4ef5dd29eb1dd0c40f..00dc69aaf9d588c2daab1ac67749b7490b29b2d1 100644 --- a/criu.spec +++ b/criu.spec @@ -1,6 +1,6 @@ Name: criu Version: 3.16.1 -Release: 5 +Release: 6 Provides: crtools = %{version}-%{release} Obsoletes: crtools <= 1.0-2 Summary: A tool of Checkpoint/Restore in User-space @@ -92,6 +92,7 @@ Patch: 0072-kabichk-add-KABI-check-code.patch %endif Patch: 0073-criu-fix-conflicting-headers.patch Patch: 0074-mount-add-definition-for-FSOPEN_CLOEXEC.patch +Patch: 0075-compel-fix-parasite-with-GCC-12.patch %description Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system. @@ -174,6 +175,9 @@ chmod 0755 %{buildroot}/run/%{name}/ %doc %{_mandir}/man1/{compel.1*,crit.1*,criu-ns.1*} %changelog +* Thu Jul 27 2023 zhoujie - 3.16.1-6 +- compel fix parasite with GCC 12 + * Wed Jan 4 2023 zhoujie - 3.16.1-5 - Fix compilation problems caused by glibc upgrade