criu/compel
Alexander Mikhalitsyn c98af78c58 compel: add -ffreestanding to force gcc not to use builtin memcpy, memset
This patch fixes the problem with SSE (xmm) registers corruption on amd64
architecture. The problem was that gcc generates parasite blob that uses
xmm registers, but we don't preserve this registers in CRIU when injecting
parasite. Also, gcc, even with -nostdlib option uses builtin memcpy,
memset functions that optimized for amd64 and involves SSE registers.

It seems, that optimal solution is to use -ffreestanding gcc option
to compile parasite. This option implies -fno-builtin and also it designed
for OS kernels compilation/another code that suited to work on non-hosted
environments and could prevent future sumilar bugs.

To check that you amd64 CRIU build affected by this problem you could simply
objdump -dS criu/pie/parasite.o | grep xmm
Output should be empty.

Reported-by: Diyu Zhou <zhoudiyupku at gmail.com>
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
Signed-off-by: Alexander Mikhalitsyn <alexander@mihalicyn.com>
2020-02-04 12:39:44 -08:00
..
arch s390x: remove stack pointer from clobber list 2020-02-04 12:39:44 -08:00
include compel/criu: Add __must_check 2020-02-04 12:39:04 -08:00
plugins kerndat: detect if system support clone3() with set_tid 2020-02-04 12:39:44 -08:00
src compel: add -ffreestanding to force gcc not to use builtin memcpy, memset 2020-02-04 12:39:44 -08:00
test compel/test: fix "infect" test compilation errors 2017-09-21 01:00:23 +03:00
.gitignore compel: adapt .gitgnore for aarch64 and ppc64le 2017-08-09 18:51:42 +03:00
compel-host compel cli: show includes 2017-03-15 00:09:55 +03:00
Makefile compel: Don't use CFLAGS_PIE for libcompel.so 2019-09-07 15:59:50 +03:00