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: 13093310 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0AA3C5479D for ; Mon, 9 Jan 2023 11:43:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 56C1B8E0002; Mon, 9 Jan 2023 06:43:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 51C4D8E0001; Mon, 9 Jan 2023 06:43:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E4718E0002; Mon, 9 Jan 2023 06:43:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2A8E18E0001 for ; Mon, 9 Jan 2023 06:43:05 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DFDD11203B4 for ; Mon, 9 Jan 2023 11:43:04 +0000 (UTC) X-FDA: 80335074288.28.A718B5A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id 678F24001E for ; Mon, 9 Jan 2023 11:43:03 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OQJWuHnA; spf=pass (imf04.hostedemail.com: domain of bjorn@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=bjorn@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673264583; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=NumBjByngagOGUAcW+W24cLGAL0n1uyNHw7q89dKJP8=; b=vadAys96xHICT7JkLiRCxMbWNrZgpkrFrNfa263HDtsOQtmzCknAkZBBnPM+7CbZipIP8u RAb4K6tEUviE515YK5Gcge7OrSsY6Yf+sxjVCvcqlXsrkFHYu5Icl/uyk1QelLet/6S1Od U9tlQPyxdgLKg+f2c5XS8nJbtMz8mho= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OQJWuHnA; spf=pass (imf04.hostedemail.com: domain of bjorn@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=bjorn@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673264583; a=rsa-sha256; cv=none; b=FNvG/WwPro3fwe4+dEzhsTXqDXLXy2AdsaEGLMyAOIOjUzLlUbGN5mDDwG7ER/v65vewWE x87lwubFJwAZWUlXzGU3KUfqBHkbWNrdsbdhcKUUN/AMA6L29tdGA8jUSsiAinr9A0ovuu /tMLCzMk/+t9ossbLC5iiBQdbdo2vlo= 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 ams.source.kernel.org (Postfix) with ESMTPS id 6CCE6B80D78; Mon, 9 Jan 2023 11:43:01 +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 X-Stat-Signature: yxtmdt46hw4a9qyy6t5t8sg88memxrxp X-Rspam-User: X-Rspamd-Queue-Id: 678F24001E X-Rspamd-Server: rspam06 X-HE-Tag: 1673264583-6080 X-HE-Meta: U2FsdGVkX19IQvPSqAmVk1ZqOUfLy1SCHEaFBFzAAbtp7coT3u9XJZ+6XIEa8zJkzCOudYj7VcYo6Xcb87nKljVh4zaNWbSSi24J7zPDRyYwOFGEN+FopH8dn+oUP1JhOHEm8TB9szbDyCwd3X2/qzUhzi9xb3IIRJuwYcB0kGaqPKj0p0cZ0P/xras11wuD68jwG2v3BqesgL0lt2f013a2TfRKuwbbgEJHXR8WyGmevy6Q8anlVo5LCz+2nLPga9Kji9IsZN2SYF/k/bGiscOp0jAjFdfjWHIc1VFBA1YHWHa6x3JKJjZkGbXFmrN13dWhfxFU7qREph3UkChi2qDoHVwFU0kEumChCPlz4zMQVTBvCrKw+H+yhnBND1DogUFpcaS858pvx6jIj1sZe8jfb5YPAcVuzrPo+pC1WHHKBrY+Y77b5WQEvvqUKB1sCTIZxjrOivHHGyGPgK1cscfZ3kAaBKpPuCf+hvb9A7cIGRAxDITIlJogB8hKt/qcLSa4UZ0Xv1TWqPOqNoYhl6Cjq1PEMTzlH6tPqOSxttS5A+mWNBcnjFiAbinQ6StO2vYOctvIxJly8yJUTR2FxDnOKWYZgGHEFfo6UOBpYl6rtCsuyBlS0qfxYKkj1NdFdQ7JfdPhf8k+MSTd7Yv+zxfPAdga+tf8yvBhe+4kVo0OEkOcD5549X1SOsxfXreTTHDrgIajiO/UNtwikD5wueKTMlNGgT89MD/B3x8oWeKr6meaTG83hmQ9Z5dgsi1qGGE/oKatuJZH8nN2RiTHO6P+J+PC+n8PmpVOK5bwVtDbuGpfXrvI0J2z7ZOhBi65fvRXIbFVcDkQx3TAPWZChL+NBAoDFg0cTybP2l3U9WKCowqYQtTeoYTAKLLKjPy6NxAd+eu+QBMPwU1oZch5+W5S07wqbUoRIPeiELJTh6cjLV/O3ekbcNsm9y0NHzoBK7M1IDO6xnnJYRdBDNC B76snXIj eo52qt8tu7gPhEI5Y2m110tpXObsCxl39ZJFsvXWycIdpiIfVaE8d5P5A24x1l2kEt0cL93642gCsPKk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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,