diff --git a/Makefile b/Makefile index 037d38fc8..ac7376c7f 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,42 @@ SRC_DIR := $(CURDIR) export SRC_DIR # -# General architecture specific options. +# Architecture specific options. +ifneq ($(filter-out x86 arm arm64 ppc64,$(ARCH)),) + $(error "The architecture $(ARCH) isn't supported") +endif + +ifeq ($(ARCH),x86) + SRCARCH := x86 + LDARCH := i386:x86-64 + VDSO := y +endif + +ifeq ($(ARCH),arm) + SRCARCH := arm +endif + +ifeq ($(ARCH),arm64) + ARCH := aarch64 + SRCARCH := aarch64 + VDSO := y +endif + +ifeq ($(ARCH),ppc64) + SRCARCH := ppc64 + LDARCH := powerpc:common64 + VDSO := y +endif + +LDARCH ?= $(SRCARCH) + +export SRCARCH LDARCH VDSO + +SRCARCH ?= $(ARCH) +LDARCH ?= $(SRCARCH) + +export SRCARCH LDARCH VDSO + UNAME-M := $(shell uname -m) export UNAME-M @@ -54,10 +89,6 @@ ifeq ($(ARCH),x86) DEFINES := -DCONFIG_X86_64 endif -ifeq ($(ARCH),aarch64) - VDSO := y -endif - # # The PowerPC 64 bits architecture could be big or little endian. # They are handled in the same way. diff --git a/criu/Makefile b/criu/Makefile index 1807c1087..19989547a 100644 --- a/criu/Makefile +++ b/criu/Makefile @@ -2,39 +2,8 @@ # 6a8d90f5fec4 "attr: Allow attribute type 0" WRAPFLAGS += -Wl,--wrap=nla_parse,--wrap=nlmsg_parse -ifeq ($(ARCH),x86) - SRCARCH := x86 - LDARCH := i386:x86-64 - VDSO := y -endif - -ifeq ($(ARCH),arm) - SRCARCH := arm -endif - -ifeq ($(ARCH),arm64) - ARCH := aarch64 - SRCARCH := aarch64 - VDSO := y -endif - -ifeq ($(ARCH),ppc64) - SRCARCH := ppc64 - LDARCH := powerpc:common64 - VDSO := y -endif - -LDARCH ?= $(SRCARCH) - -export SRCARCH LDARCH VDSO - -SRCARCH ?= $(ARCH) -LDARCH ?= $(SRCARCH) ARCH_DIR := arch/$(SRCARCH) - -export SRCARCH LDARCH ARCH_DIR VDSO - -$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported")) +export ARCH_DIR # # General flags.