From: Björn Töpel Date: Mon, 9 Jan 2023 11:42:51 +0000 (+0100) Subject: selftests: vm: enable cross-compilation X-Git-Tag: v6.6.7~3441^2~368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a3f21fe5cb9f5654ccad7ba712d868f7de66e39;p=platform%2Fkernel%2Flinux-starfive.git selftests: vm: enable cross-compilation Selftests vm builds break when doing cross-compilation. The Makefile MACHINE variable incorrectly picks upp the host machine architecture. If the CROSS_COMPILE variable is set, dig out the target host architecture from CROSS_COMPILE, instead of calling uname. Link: https://lkml.kernel.org/r/20230109114251.3349638-1-bjorn@kernel.org Signed-off-by: Björn Töpel Cc: Shuah Khan Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 6a4b639..0a44d77 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -5,7 +5,11 @@ LOCAL_HDRS += $(selfdir)/mm/local_config.h $(top_srcdir)/mm/gup_test.h include local_config.mk +ifeq ($(CROSS_COMPILE),) uname_M := $(shell uname -m 2>/dev/null || echo not) +else +uname_M := $(shell echo $(CROSS_COMPILE) | grep -o '^[a-z0-9]\+') +endif MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/ppc64/') # Without this, failed build products remain, with up-to-date timestamps,