[CRIU] [PATCH 01/10] build: Remove SRCARCH

Dmitry Safonov dima at arista.com
Fri Nov 22 00:56:34 MSK 2019


SRCARCH is always equal ARCH. There are no rules when to use one or
another and architectures may forget to set one of them up.

No need for a second variable meaning the same and confusing people.
Remove it completely.

Self-correction [after some debug]: SRCARCH was different in one place:
zdtm Makefile by some unintentional mistake:
> ifeq ($(ARCH),arm64)
>         ARCH		?= aarch64
>         SRCARCH	?= aarch64
> endif

That meant to be "ARCH := aarch64" because "?=" would never work inside
that ifeq. Fix up this part of mess too.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 Makefile                  | 3 +--
 Makefile.config           | 2 +-
 compel/plugins/Makefile   | 4 ++--
 criu/Makefile             | 2 +-
 criu/pie/Makefile         | 6 +++---
 criu/pie/Makefile.library | 4 ++--
 test/zdtm/Makefile.inc    | 7 ++-----
 test/zdtm/static/Makefile | 4 ++--
 8 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index f827e7baa7e2..2e62f6f39ea5 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,6 @@ endif
 # commit "S/390: Fix 64 bit sibcall".
 ifeq ($(ARCH),s390)
         ARCH		:= s390
-        SRCARCH		:= s390
         DEFINES		:= -DCONFIG_S390
         CFLAGS_PIE	:= -fno-optimize-sibling-calls
 endif
@@ -94,7 +93,7 @@ endif
 CFLAGS_PIE		+= -DCR_NOGLIBC
 export CFLAGS_PIE
 
-LDARCH ?= $(SRCARCH)
+LDARCH ?= $(ARCH)
 export LDARCH
 export PROTOUFIX DEFINES
 
diff --git a/Makefile.config b/Makefile.config
index 1e4352b9de2a..5af3fed389a1 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -30,7 +30,7 @@ CONFIG_FILE = .config
 $(CONFIG_FILE):
 	touch $(CONFIG_FILE)
 
-ifeq ($(SRCARCH),x86)
+ifeq ($(ARCH),x86)
 # CONFIG_COMPAT is only for x86 now, no need for compile-test other archs
 ifeq ($(call try-asm,$(FEATURE_TEST_X86_COMPAT)),true)
         export CONFIG_COMPAT := y
diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index a326e2a661a3..197ff1b24efa 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -53,11 +53,11 @@ std-lib-y		+= ./$(PLUGIN_ARCH_DIR)/std/parasite-head.o
 target			+= fds
 fds-lib-y		+= fds/fds.o
 
-ifeq ($(SRCARCH),x86)
+ifeq ($(ARCH),x86)
 	std-lib-y	+= ./$(PLUGIN_ARCH_DIR)/std/memcpy.o
 endif
 
-ifeq ($(SRCARCH),ppc64)
+ifeq ($(ARCH),ppc64)
 	std-lib-y	+= ./$(PLUGIN_ARCH_DIR)/std/memcpy.o
 	std-lib-y	+= ./$(PLUGIN_ARCH_DIR)/std/memcmp.o
 endif
diff --git a/criu/Makefile b/criu/Makefile
index 4134e5052e30..ceb49ce09925 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -2,7 +2,7 @@
 # 6a8d90f5fec4 "attr: Allow attribute type 0"
 WRAPFLAGS		+= -Wl,--wrap=nla_parse,--wrap=nlmsg_parse
 
-ARCH_DIR		:= criu/arch/$(SRCARCH)
+ARCH_DIR		:= criu/arch/$(ARCH)
 PIE_DIR			:= criu/pie
 export ARCH_DIR PIE_DIR
 
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 1ad456f43007..a30747ac30d5 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -14,7 +14,7 @@ ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
         compel_plugins	:= $(shell $(COMPEL_BIN) plugins)
 endif
 
-LDS		:= compel/arch/$(SRCARCH)/scripts/compel-pack.lds.S
+LDS		:= compel/arch/$(ARCH)/scripts/compel-pack.lds.S
 
 restorer-obj-y	+= parasite-vdso.o ./$(ARCH_DIR)/vdso-pie.o
 restorer-obj-y	+= ./$(ARCH_DIR)/restorer.o
@@ -26,11 +26,11 @@ ifeq ($(ARCH),x86)
         endif
 endif
 
-ifeq ($(SRCARCH),aarch64)
+ifeq ($(ARCH),aarch64)
         restorer-obj-y	+= ./$(ARCH_DIR)/intraprocedure.o
 endif
 
-ifeq ($(SRCARCH),ppc64)
+ifeq ($(ARCH),ppc64)
         restorer-obj-y	+= ./$(ARCH_DIR)/vdso-trampoline.o
 endif
 
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index 658c8a4eb80a..de75b11d4621 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -9,14 +9,14 @@ lib-name		:= pie.lib.a
 lib-y			+= util.o
 lib-y			+= util-vdso.o
 
-ifeq ($(SRCARCH),x86)
+ifeq ($(ARCH),x86)
         ifeq ($(CONFIG_COMPAT),y)
                 lib-y	+= util-vdso-elf32.o
         endif
         CFLAGS_util-vdso-elf32.o	+= -DCONFIG_VDSO_32
 endif
 
-ifeq ($(SRCARCH),arm)
+ifeq ($(ARCH),arm)
         lib-y		+= ./$(ARCH_DIR)/aeabi-helpers.o
         lib-y		+= ./$(ARCH_DIR)/pie-cacheflush.o
 endif
diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc
index 170f31632e9e..d5c013a3e852 100644
--- a/test/zdtm/Makefile.inc
+++ b/test/zdtm/Makefile.inc
@@ -15,12 +15,9 @@ ARCH ?= $(shell uname -m | sed          \
                 -e s/aarch64.*/arm64/)
 
 ifeq ($(ARCH),arm64)
-        ARCH		?= aarch64
-        SRCARCH		?= aarch64
+        ARCH	:= aarch64
 endif
 
-SRCARCH ?= $(ARCH)
-
 ifeq ($(ARCH),arm)
 	ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
 
@@ -35,7 +32,7 @@ CC	:= gcc
 CFLAGS	+= -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 CFLAGS	+= $(USERCFLAGS)
 CFLAGS	+= -D_GNU_SOURCE
-CPPFLAGS += -iquote $(LIBDIR)/arch/$(SRCARCH)/include
+CPPFLAGS += -iquote $(LIBDIR)/arch/$(ARCH)/include
 
 ifeq ($(strip $(V)),)
 	E = @echo
diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index a38482f44ee3..e0d4d2c5cbb9 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -219,13 +219,13 @@ TST_NOFILE	:=				\
 		child_subreaper_and_reparent	\
 #		jobctl00			\
 
-ifneq ($(SRCARCH),arm)
+ifneq ($(ARCH),arm)
 ifneq ($(COMPAT_TEST),y)
         TST_NOFILE += maps03
 endif
 endif
 
-ifeq ($(SRCARCH),s390)
+ifeq ($(ARCH),s390)
         TST_NOFILE +=	s390x_regs_check	\
 			s390x_gs_threads	\
 			s390x_runtime_instr
-- 
2.24.0



More information about the CRIU mailing list