Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6097627rwl; Mon, 9 Jan 2023 04:17:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuUmeFqsSe2c7upOCqmGvSwlgldVzW9B4uMye2E06n9S3b9tmbnem0nlMBmWcIRy0I+hjfH X-Received: by 2002:a17:902:eb8c:b0:193:2ed4:5623 with SMTP id q12-20020a170902eb8c00b001932ed45623mr3622998plg.26.1673266643782; Mon, 09 Jan 2023 04:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673266643; cv=none; d=google.com; s=arc-20160816; b=FJZQvScxWbiccmh8u+q7Cwk/nxbZz0ye8rRGOpfu4ICeuDHFfZYhZ+lyWMqMi4aO23 GSwsVemtR/AV/egLV5iwp6nmhoZwwAi8VOR1JKzS+9tMyv8A63HaxVgmz1SuIM+e5Y9M XZkcAX2bP5jS9k9bLZrKyhLSnxs/P483cBZa2YCS6oa5ebRPJt3fns8JDk9T0u8OH+wM BudT/rQGsRkQB5xzNsvO4w2iBcgn3fHHup6jIsR3YBgRmKH4jI6TPlXraHBHTgkcVonj Y3F1iBCLwe8p8eW371wq0mvffvdr/E6Q9ZKTdtLnMP523Z7AkPrt7oiBpn6wZurvshZH dTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NumBjByngagOGUAcW+W24cLGAL0n1uyNHw7q89dKJP8=; b=esr9KhA/WrZFpcDnRmcjaDLhgsmvPWwzqN50aCAqRHGLZVFXeiX2M2wA25wVDUXHhc uhJG5EmSxr+poo4dew9C3m5/YY2qwgOJ7gNuE5Sl4FhiI64SA6I+2Fm52WFOThZag3p5 qo38dh465wm58nKnyTpcW++csC+Q9Z0x0WYHFSLbQh1ZEyNppl2LbYeLY3a0K/j1XvZm UgwLfovfLBVScxjgiVwFEQJfAuWPmkQtZU2UdmLhfWzlW34+CkZLoaRrZnjhf/+XZ8uh OYBucPGIUzXMsIimwUhgrPWBiMNO6N2fIin54+lEgnK+T8PZYDXRbyjq+xvX5TVc0H+s eWQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OQJWuHnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a170902e5c800b0018948b0082fsi9801301plf.244.2023.01.09.04.17.17; Mon, 09 Jan 2023 04:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OQJWuHnA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233715AbjAILnM (ORCPT + 54 others); Mon, 9 Jan 2023 06:43:12 -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?q?Bj=C3=B6rn=20T=C3=B6pel?= To: Andrew Morton , linux-mm@kvack.org Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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, base-commit: 1fe4fd6f5cad346e598593af36caeadc4f5d4fa9 -- 2.37.2