From patchwork Mon Jan 9 11:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13093309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA109C5479D for ; Mon, 9 Jan 2023 11:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234042AbjAILnJ (ORCPT ); Mon, 9 Jan 2023 06:43:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237012AbjAILnC (ORCPT ); Mon, 9 Jan 2023 06:43:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312FD20D; Mon, 9 Jan 2023 03:43:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BCCDB6102E; Mon, 9 Jan 2023 11:43:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D185CC433EF; Mon, 9 Jan 2023 11:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673264580; bh=k4VFwDwt+3kN+Vy2Mbffh4lRQPurzk1UNIus5/rXg4I=; h=From:To:Cc:Subject:Date:From; b=OQJWuHnAubh118bda8DEf94hNpg3w0eNF5RRtif1owHukw9rd0cUn3AgyQI36Xk/3 3GIUuSXDdGXXmC5CDcBCulDRftNEb6CXJuWqDy3dGUycik5Tbtf0jOv94JCl2xvbx0 TwCtP+vqyWBgI/eudylW2rAY8qnpTchD+KZ/hzFcM1KIGmWt+NiM5a82s60QWf16zf pGGjPB6wIEKVvDWw+vtdiPOnXXZalE+wppcIhD/J5Ws0l8nx3jvDVKBikla4bhujHs HzjGOcSXxsZapwlv/T5lRYNBnYlER6i14FVo66EiPiuKFJCDrKXV5kkSdit2ePg1j3 4YyIzTXrHneag== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Andrew Morton , linux-mm@kvack.org Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: vm: Enable cross-compilation Date: Mon, 9 Jan 2023 12:42:51 +0100 Message-Id: <20230109114251.3349638-1-bjorn@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Björn Töpel 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. Signed-off-by: Björn Töpel --- tools/testing/selftests/vm/Makefile | 4 ++++ 1 file changed, 4 insertions(+) base-commit: 1fe4fd6f5cad346e598593af36caeadc4f5d4fa9 diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 89c14e41bd43..1cded308dddf 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -5,7 +5,11 @@ LOCAL_HDRS += $(selfdir)/vm/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,