Commit 3a949863 authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

cr: determine the version of the ARM architecture of the target machine

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: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5eb254b0
...@@ -39,8 +39,6 @@ OBJCOPY := $(CROSS_COMPILE)objcopy ...@@ -39,8 +39,6 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
ARCH ?= $(shell uname -m | sed \ ARCH ?= $(shell uname -m | sed \
-e s/i.86/i386/ \ -e s/i.86/i386/ \
-e s/sun4u/sparc64/ \ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-e s/s390x/s390/ \ -e s/s390x/s390/ \
-e s/parisc64/parisc/ \ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ \ -e s/ppc.*/powerpc/ \
...@@ -57,11 +55,19 @@ ifeq ($(ARCH),x86_64) ...@@ -57,11 +55,19 @@ ifeq ($(ARCH),x86_64)
LDARCH := i386:x86-64 LDARCH := i386:x86-64
endif 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 := arm
ARCH_DEFINES := -DCONFIG_ARM DEFINES := -DCONFIG_ARM -DCONFIG_ARMV$(ARMV)
LDARCH := arm LDARCH := arm
CFLAGS += -march=armv7-a
ifeq ($(ARMV),6)
CFLAGS += -march=armv6
endif
ifeq ($(ARMV),7)
CFLAGS += -march=armv7-a
endif
endif endif
SRC_DIR ?= $(CURDIR) SRC_DIR ?= $(CURDIR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment