[CRIU] [PATCH 3/3] criu/pie/Makefile: disable FORTIFY_SOURCE
Kir Kolyshkin
kir at openvz.org
Thu Nov 10 16:32:28 PST 2016
This is highly controversial, but fixes the following compilation
problem with Alpine Linux (i.e. musl libc) caused by the previous
commit (""):
> gcc -c -O2 -g -Wall -Wformat-security -Werror -D_FILE_OFFSET_BITS=64
> -D_GNU_SOURCE -iquote include/ -iquote /criu/compel/include -iquote
> /criu/criu/arch/x86/include -iquote /criu/criu/include -iquote
> /criu/include -iquote /criu -fno-strict-aliasing -iquote
> /criu/criu/include -iquote /criu/include -iquote /criu/images -iquote
> /criu/criu/pie -iquote /criu/criu/arch/x86 -iquote
> /criu/criu/arch/x86/include -iquote /criu/ -I/usr/include/libnl3 -iquote
> compel/plugins/include -iquote compel/include -iquote
> compel/arch/x86/plugins/std -iquote /criu/compel/plugins/include -iquote
> /criu/compel/include -DCR_NOGLIBC -Wstrict-prototypes
> -fno-stack-protector -nostdlib -fomit-frame-pointer -fpie
> -DCONFIG_X86_64 criu/pie/parasite.c -o criu/pie/parasite.o
> In file included from /criu/criu/include/util.h:10:0,
> from /criu/criu/include/restorer.h:13,
> from criu/pie/parasite.c:23:
> /usr/include/fortify/string.h:37:27: error: redefinition of 'memcpy'
> _FORTIFY_FN(memcpy) void *memcpy(void *__od, const void *__os, size_t
> __n)
> ^
> In file included from
> compel/plugins/include/uapi/std/syscall-types.h:13:0,
> from compel/plugins/include/uapi/std/syscall-64.h:5,
> from compel/plugins/include/uapi/std/syscall.h:8,
> from criu/pie/parasite.c:11:
> /usr/include/sched.h:72:7: note: previous definition of 'memcpy' was
> here
> void *memcpy(void *__restrict, const void *__restrict, size_t);
> ^
> In file included from /criu/criu/include/util.h:10:0,
> from /criu/criu/include/restorer.h:13,
> from criu/pie/parasite.c:23:
> /usr/include/fortify/string.h:64:27: error: redefinition of 'memset'
> _FORTIFY_FN(memset) void *memset(void *__d, int __c, size_t __n)
> ^
> In file included from /usr/include/fortify/string.h:20:0,
> from /criu/criu/include/util.h:10,
> from /criu/criu/include/restorer.h:13,
> from criu/pie/parasite.c:23:
> /usr/include/string.h:27:7: note: previous definition of 'memset' was
> here
> void *memset (void *, int, size_t);
> ^
> /criu/scripts/nmk/scripts/build.mk:103: recipe for target
> 'criu/pie/parasite.o' failed
>
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
criu/pie/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index f8124b8..985d734 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -55,6 +55,7 @@ CFLAGS += -iquote $(SRC_DIR)
ccflags-y += -iquote $(SRC_DIR)/compel/plugins/include
ccflags-y += -iquote $(SRC_DIR)/compel/include
ccflags-y += -DCR_NOGLIBC
+ccflags-y += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
NATIVE_CFLAGS := $(shell $(SRC_DIR)/compel/compel-host --arch=$(ARCH) cflags)
ifeq ($(ARCH),x86)
--
2.7.4
More information about the CRIU
mailing list