[CRIU] [PATCH 1/4] cr: determine the version of the ARM architecture of the target machine

Alexander Kartashov alekskartashov at parallels.com
Wed Jul 10 02:15:54 EDT 2013


This patch modifies the build system to analyze the version
of the target ARM architecture and setup the compiler flags
accordingly. This makes it possible to support the ARM
architectures prior to ARMv7.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>

---
 Makefile |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 705e4da..4bf462e 100644
--- a/Makefile
+++ b/Makefile
@@ -39,8 +39,6 @@ OBJCOPY		:= $(CROSS_COMPILE)objcopy
 ARCH ?= $(shell uname -m | sed		\
 		-e s/i.86/i386/		\
 		-e s/sun4u/sparc64/	\
-		-e s/arm.*/arm/		\
-		-e s/sa110/arm/		\
 		-e s/s390x/s390/	\
 		-e s/parisc64/parisc/	\
 		-e s/ppc.*/powerpc/	\
@@ -57,11 +55,19 @@ ifeq ($(ARCH),x86_64)
 	LDARCH       := i386:x86-64
 endif
 
-ifeq ($(ARCH),arm)
+ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
+	ARMV         := $(shell echo $(ARCH) | sed -r -e 's/armv([[:digit:]]).*/\1/')
 	ARCH         := arm
-	ARCH_DEFINES := -DCONFIG_ARM
+	DEFINES      := -DCONFIG_ARM -DCONFIG_ARMV$(ARMV)
 	LDARCH       := arm
-	CFLAGS       += -march=armv7-a
+
+	ifeq ($(ARMV),6)
+		CFLAGS += -march=armv6
+	endif
+
+	ifeq ($(ARMV),7)
+		CFLAGS += -march=armv7-a
+	endif
 endif
 
 SRC_DIR		?= $(CURDIR)
-- 
1.7.10.4



More information about the CRIU mailing list