From patchwork Sun Jun 25 16:39:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 112667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7008409vqr; Sun, 25 Jun 2023 10:00:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cgsngM11IfmzJgQnnaqXj/mpXsC2wfuKWtkMv4PwLyAQg9zjTgf7fN2otnbrCVc686frj X-Received: by 2002:a17:902:d4c7:b0:1b6:9de1:eae5 with SMTP id o7-20020a170902d4c700b001b69de1eae5mr2611473plg.20.1687712439587; Sun, 25 Jun 2023 10:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687712439; cv=none; d=google.com; s=arc-20160816; b=xnPO20a1YrS9Hg+xQ2SgyE3uPjTL2id+07Ty7lKq702VQlvLgPT99akBbUAV9hBwx8 HxOIVIeyx1oe3obAPc09HdpHjAI6K1IulU6z6aVM1Zt5FWCm64N06YEt9XAPEppOUaQ4 9hJLLE56tJ9nCTFbXc/ilS5j7ood5lbDSAVeMnC4Oe6OMULkwJUHnB198M5lg90tgjZ7 YF9+5apjsTtnf+RED/3OeKg10nE7UPfPign6vZSCu56NIBE4HJy/lcur8qwClbf4E9bs Eg5CbL3em5Cy+Oz+HdgRchW8faF/ZDwPGdhIF6JFkThw1cYsP2tr+FM9jiMl/3enDUSx 0uZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+dujPQKZdAjU0dsN3luSGz5UmeSwMZyulJvPFOPSlWo=; fh=GzghTQzqgly4pZn8BwQ4U8bZ8zCadAK8Sl/utskeyEs=; b=zTkdpYBRF5G4AXXGT+z3G+bUP0uDHrvDpDDr8Ezn7a0NOBO6ZS0qkskPkFaw4xb5sx KP4wlSNoSCrmNiydRC4/lMQtzPD3sr17cbCAc1+fGPnn3lolmGk+/KDXf2RmC/vTmMBB 8G9a4abrWrNoUbDRitwd1QTJJUdWSzHJbM67ddBXbxBjoRieetlkU8QmuTMEEwnzvITp blQPC6NpYzMQmi0t3DxYvxn/o34QvRBfXvXYY5bb6H/cWRIZnIB9TDiyy+u93XFQYGol 1/aErhOja4JuKVbO5wHRAlwIRAnamw7jq89CjaCe6dE681AFcokmS7XgoJKnId2mI47P Nrog== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a17090301cd00b001ab29e16b3asi3560888plh.286.2023.06.25.10.00.27; Sun, 25 Jun 2023 10:00:39 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbjFYQkc (ORCPT + 99 others); Sun, 25 Jun 2023 12:40:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjFYQkb (ORCPT ); Sun, 25 Jun 2023 12:40:31 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F27B9; Sun, 25 Jun 2023 09:40:29 -0700 (PDT) X-QQ-mid: bizesmtp83t1687711219tx6hnmn1 Received: from linux-lab-host.localdomain ( [116.30.129.193]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 26 Jun 2023 00:40:18 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: znfcQSa1hKZqkmvXmtk4w2PqRZkl6g8YSFZFLRaCCD2Q9Qr0cKHfrxz1j5Oc7 qrqCMPwRHqHkl11Msd8LYesoCQIlP+Q+Fx9dLpcPU0/07y9SlF9d34z/l9arx1QkrsLh6S5 eylyhUe0Ulm9cHjqbtDv2QGbH1VT0l5qF0x1Q1EqLZj6ShuaRRhdWDduoBADK40lNAS5aKE QjdPqx9LmVcpGN6iGbzxbTXpv8eArmXIRy+CvdTWOPiMz8+S7TSsjByBKz1ca90xi9mNJ68 L3kF6gi1mMxDtXCQKY39ncXHB3pOtFQ3oxpVbrhFwnR7HKp6kfFxkE9oyaOpKEC0d3doxqg Sk+p/1Ci+XA1QZSMlhDDPo750RP2Zigg/olwBCAVUXFdUrOTvvWqMrIIDHZ7A== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6776819239009598717 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v1 19/22] selftests/nolibc: config default CROSS_COMPILE Date: Mon, 26 Jun 2023 00:39:39 +0800 Message-Id: <0ef9f42e04b8b62b8d53c0f3106f5e50629e01d5.1687706332.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769694758997217916?= X-GMAIL-MSGID: =?utf-8?q?1769694758997217916?= This further simplify the 'make' commands, only require an ARCH now. Almost all distributions provide toolchains for i386, x86_64, arm64, arm, mips, riscv32, riscv64 and s390x. If can not find toolchains from the distribution repositories, we can download them from https://mirrors.edge.kernel.org/pub/tools/crosstool/ and then customize CROSS_COMPILE_ for the testing. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 9092d209ebd0..a847a2264fed 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -74,6 +74,25 @@ EXTCONFIG_ARCH = $(EXTCONFIG_$(ARCH)) # extra kernel configs, include common + architecture specific EXTCONFIG = $(EXTCONFIG_ARCH) $(EXTCONFIG_COMMON) +# CROSS_COMPILE by architecture +CROSS_COMPILE_i386 ?= x86_64-linux-gnu- +CROSS_COMPILE_x86_64 ?= x86_64-linux-gnu- +CROSS_COMPILE_x86 ?= x86_64-linux-gnu- +CROSS_COMPILE_arm64 ?= aarch64-linux-gnu- +CROSS_COMPILE_arm ?= arm-linux-gnueabi- +CROSS_COMPILE_mips ?= mipsel-linux-gnu- +CROSS_COMPILE_riscv32 ?= riscv64-linux-gnu- +CROSS_COMPILE_riscv64 ?= riscv64-linux-gnu- +CROSS_COMPILE_riscv ?= riscv64-linux-gnu- +CROSS_COMPILE_s390 ?= s390x-linux-gnu- +CROSS_COMPILE_loongarch ?= loongarch64-linux- +CROSS_COMPILE ?= $(CROSS_COMPILE_$(ARCH)) + +# Make sure CC has $(CROSS_COMPILE) prefix +ifneq ($(CC),$(CROSS_COMPILE)$(CC)) +CC := $(CROSS_COMPILE)$(CC) +endif + # optional tests to run (default = all) TEST =