[CRIU] [PATCH] Fix Fedora compile (undo _FORTIFY_SOURCE for pie)

Kir Kolyshkin kir at openvz.org
Thu Feb 16 23:12:57 PST 2017


Recent Fedora releases add -Wp,-D_FORTIFY_SOURCE=2 to rpm builds,
which breaks compiling pie code on some architectures due to its
trying to use (absent) memcpy_chk() instead of usual memcpy().

We must stand strong against FORTIFY_SOURCE in pie code.
No pasaran! Viva la resistance!

NOTE: in tests, FORTIFY_SOURCE is disabled for completely different
reasons (see commit d1a36cc for details), so we're not touching it.

Reported-by: Adrian Reber <adrian at lisas.de>
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/plugins/Makefile | 1 +
 criu/pie/Makefile       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index ac23a11..cea3125 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -2,6 +2,7 @@
 
 CFLAGS			:= $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS))
 CFLAGS			+= -DCR_NOGLIBC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
+CFLAGS			+= -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
 CFLAGS			:= $(filter-out $(CFLAGS-ASAN),$(CFLAGS))
 PLUGIN_ARCH_DIR		:= compel/arch/$(ARCH)/plugins
 
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index f6e9ff2..45adbc1 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -30,6 +30,7 @@ CFLAGS		+= -iquote $(SRC_DIR)
 ccflags-y	+= $(COMPEL_UAPI_INCLUDES)
 ccflags-y	+= -DCR_NOGLIBC
 ccflags-y	+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
+ccflags-y	+= -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
 
 ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
         CFLAGS	+= $(shell $(COMPEL_BIN) cflags)
-- 
2.9.3



More information about the CRIU mailing list