criu/scripts
Kir Kolyshkin 0367a1f6fe Drop prefix from own memcpy/memset/memcmp
C compiler might generate calls to memcpy, memset, memcmp, and memmove
as it seem fit (so far we haven't seen memmove being required). That
means we need to provide our own versions of it for code which is not
linked to a libc.

We already have a solution for that in commit bdf6051
("pie: provide memcpy/memcmp/memset for noglibc case")
but we faced another problem of compiler trying to optimize
our builtin_memset() by inserting calls to memset() which
is just an alias in our case and so it lead to infinite recursion.
This was workarounded in commit 8ea0ba7 ("string.h: fix memset
over-optimization with clang") but it's not clear that was a proper
fix.

This patch is considered to be the real solution. As we don't have
any other implementations of memset/memcpy/memcmp in non-libc case,
we can call ours without any prefixes and avoid using weak aliases.

Implementation notes:

1. mem*() functions code had to be moved from .h to .c for the functions
to be compatible with their prototypes declared in /usr/include/string.h
(i.e. "extern").

2. FORTIFY_SOURCE needed to be disabled for code not linked to libc,
because otherwise memcpy() may be replaced with a macro that expands
to __memcpy_chk() which of course can't be resolved during linking.

https://travis-ci.org/kolyshkin/criu/builds/198415449
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-06 13:29:54 +03:00
..
build Drop prefix from own memcpy/memset/memcmp 2017-02-06 13:29:54 +03:00
nmk nmk: recompile/regenerate on Makefile changes 2017-02-03 18:04:23 +03:00
travis zdtm: check sequence numbers for tcp sockets 2017-01-16 11:04:49 +03:00
crit-setup.py build: pycriu -- Move into lib/py 2016-02-19 14:32:19 +03:00
fake-restore.sh scripts: Add script to abort restore at the end 2014-02-05 19:40:47 +04:00
feature-tests.mak net: restore macvlan by the same way with and without userns 2016-11-03 18:17:14 +03:00
flake8.cfg zdtm: use flake8 to verify zdtm.py 2016-06-28 13:09:35 +03:00
gen-offsets.sh build: Move pie/gen-offsets.sh into scripts/ 2013-10-15 11:30:41 +04:00
install-debian-pkgs.sh Add script to install required packages to compile in Debian 2016-09-26 15:42:43 +03:00
magic-gen.py scripts: add magic-gen.py 2015-01-14 20:44:45 +04:00
protobuf-gen.sh build/make: return to make from top directory 2016-08-01 18:38:32 +03:00
systemd-autofs-restart.sh systemd-autofs-restart.sh: explicitly return result from get_fs_type 2016-10-10 12:48:20 +03:00
tmp-files.sh tmpfiles: implement user tmp files feature 2016-03-09 12:48:33 +03:00