[CRIU] [PATCHv2 2/5] make/x86: get cflags for ia32 from compel tool

Dmitry Safonov dsafonov at virtuozzo.com
Fri Sep 16 11:37:11 PDT 2016


  I think, we could transpher also `-m elf_i386' and `-m32' to
compel output - but only in case if we will not support
native x86_32 in compel (as they are wrong for native build).
Or introduce something like compat_ia32 in compel option, not sure.
Left in makefile for a while.
  Also it would be good to remove $(LD_R) in makefile and use
compel output for ldflags, but that will be valid only when compel
will support arm arch.

Fixes (with the following patches):
  GEN      criu/pie/parasite-compat-blob.h
parasite_compat_blob: Error (compel/handle-elf-32.c:322): Unexpected undefined symbol: `__stack_chk_fail'. External symbol in PIE?

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/pie/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 2a07aa901bd9..1b11acfb0646 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -55,11 +55,14 @@ CFLAGS			+= -iquote $(SRC_DIR)
 ccflags-y		+= -DCR_NOGLIBC
 ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
 NATIVE_CFLAGS		:= $(shell $(SRC_DIR)/compel/compel --arch=$(ARCH) cflags)
+ifeq ($(ARCH),x86)
+        COMPAT_CFLAGS	:= $(shell $(SRC_DIR)/compel/compel --arch=ia32 cflags)
+endif
 endif
 
 ifeq ($(ARCH),x86)
         NATIVE_CFLAGS	+= -DCONFIG_X86_64
-        COMPAT_CFLAGS	+= -fno-pic -m32 -DCONFIG_X86_32
+        COMPAT_CFLAGS	+= -m32 -DCONFIG_X86_32
         COMPAT_LDFLAGS	+= -m elf_i386
 endif
 
-- 
2.9.0



More information about the CRIU mailing list