On Tue, Jan 18, 2022 at 05:40:31PM +0100, Adrian Reber wrote:
> If there are bugs on the compiler side, please let me know
immediately,
> so that those bugs can be fixed before the mass rebuild next week.
Not sure if it is a bug, CRIU no longer works with GCC 12.
CRIU creates something called 'parasite code' which is injected into
running processes for checkpointing and that part is built with
'-nostdlib'. Starting with GCC 12 we see 'strlen()' being pulled into
the parasite code which it wasn't with GCC 11.
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).
If you mail me preprocessed source of handle-elf-host.c + gcc
command line used to compile it, I can have a look what exactly changed.
https://kojipkgs.fedoraproject.org/work/tasks/6033/81406033/build.log
gcc -c -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -Wall
-Wformat-security -Wdeclaration-after-statement -Wstrict-prototypes -DCONFIG_X86_64
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DCONFIG_HAS_LIBBSD -DCONFIG_HAS_SELINUX
-DCONFIG_GNUTLS -DCONFIG_HAS_NFTABLES_LIB_API_1 -DCONFIG_COMPAT -iquote include/
-DCONFIG_HAS_LIBBSD -DCONFIG_HAS_SELINUX -DCONFIG_GNUTLS -DCONFIG_HAS_NFTABLES_LIB_API_1
-DCONFIG_COMPAT -I ./compel/include/uapi -fno-strict-aliasing -iquote criu/include -iquote
include -iquote images -iquote criu/arch/x86/include -iquote . -I/usr/include/libnl3
-DSYSCONFDIR='"/etc"'
-DGLOBAL_CONFIG_DIR='"/etc/criu/"'
-DDEFAULT_CONFIG_FILENAME='"default.conf"'
-DUSER_CONFIG_DIR='".criu/"' -DCR_NOGLIBC -Wstrict-prototypes
-fno-stack-protector -nostdlib -fomit-frame-pointer -fpie -I ./compel/include/uapi
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
criu/pie/restorer.c -o criu/pie/restorer.o
ld -r -z noexecstack -T ./compel/arch/x86/scripts/compel-pack.lds.S -o
criu/pie/restorer.built-in.o criu/pie/parasite-vdso.o ./criu/arch/x86/vdso-pie.o
./criu/arch/x86/restorer.o ./criu/arch/x86/restorer_unmap.o
./criu/arch/x86/sigaction_compat_pie.o criu/pie/restorer.o criu/pie/pie.lib.a
./compel/plugins/std.lib.a
./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?
make[2]: *** [criu/pie/Makefile:58: criu/pie/restorer-blob.h] Error 255
make[1]: *** [criu/Makefile:59: pie] Error 2
make: *** [Makefile:250: criu] Error 2
Not sure why there is 'strlen()' pulled in with GCC 12. Any ideas?
Jakub