[CRIU] [PATCH 06/10] build: Use cflags from compel for pie.lib.a

Dmitry Safonov dima at arista.com
Sat May 18 01:53:05 MSK 2019


As pie.lib.a linked also to PIEs - we need to use missing flags as
-nostdlib and -fomit-frame-pointer.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 criu/Makefile             | 1 +
 criu/pie/Makefile         | 1 -
 criu/pie/Makefile.library | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/Makefile b/criu/Makefile
index 1e9a167895ad..3de6eb217e5a 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -9,6 +9,7 @@ export ARCH_DIR PIE_DIR
 ifeq ($(filter clean mrproper,$(MAKECMDGOALS)),)
         CFLAGS		+= $(shell $(COMPEL_BIN) includes)
         COMPEL_LIBS	:= $(shell $(COMPEL_BIN) --static libs)
+        CFLAGS_PIE	+= $(shell $(COMPEL_BIN) cflags)
 endif
 
 #
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 526e4e1ad451..35aa78bd370e 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -11,7 +11,6 @@ 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)
 	LDFLAGS		+= $(shell $(COMPEL_BIN) ldflags)
 	compel_plugins	:= $(shell $(COMPEL_BIN) plugins)
 endif
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index 467dfd6b6524..2d11ad9235ef 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -6,7 +6,7 @@
 
 lib-name		:= pie.lib.a
 
-CFLAGS			+= -fno-stack-protector -DCR_NOGLIBC -fpie
+CFLAGS			+= -DCR_NOGLIBC
 
 lib-y			+= util.o
 
-- 
2.21.0



More information about the CRIU mailing list