diff --git a/Makefile b/Makefile index 3da6a4bec..5b1c2604b 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm) endif endif +SRCARCH ?= $(ARCH) LDARCH ?= $(SRCARCH) SRC_DIR ?= $(CURDIR) @@ -108,7 +109,7 @@ CRIU-SO := libcriu CRIU-LIB := lib/$(CRIU-SO).so CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto -export CC MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS CRIU-SO +export CC MAKE CFLAGS LIBS SRCARCH DEFINES MAKEFLAGS CRIU-SO export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD export cflags-y diff --git a/pie/Makefile b/pie/Makefile index dbe6d6bba..3902e6392 100644 --- a/pie/Makefile +++ b/pie/Makefile @@ -15,7 +15,7 @@ restorer-obj-e += $(ARCH_DIR)/vdso-pie.o restorer-libs-e += $(SYSCALL-LIB) cflags-y += -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector -ifeq ($(ARCH), arm) +ifeq ($(SRCARCH), arm) cflags-y += -marm endif ASMFLAGS += -D__ASSEMBLY__ diff --git a/protobuf/Makefile b/protobuf/Makefile index a1a3fe89b..317b34143 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -85,7 +85,7 @@ $(obj)/%.proto.c.d: $(obj)/%.proto | $(obj)/%.proto.d $(obj)/%.pb-c.c $(obj)/%.pb-c.h: $(obj)/%.proto $(obj)/%.proto.c.d $(E) " PBCC " $@ $(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $< -ifeq ($(ARCH),arm) +ifeq ($(SRCARCH),arm) $(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $@ $(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $(patsubst %.c,%.h,$@) $(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $(patsubst %.h,%.c,$@)