From patchwork Thu Aug 3 11:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13339865 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 68878C001DF for ; Thu, 3 Aug 2023 11:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232809AbjHCLvH (ORCPT ); Thu, 3 Aug 2023 07:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjHCLvG (ORCPT ); Thu, 3 Aug 2023 07:51:06 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3AE72D54; Thu, 3 Aug 2023 04:50:59 -0700 (PDT) X-QQ-mid: bizesmtp75t1691063449tqmo2qcn Received: from linux-lab-host.localdomain ( [116.30.131.233]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 03 Aug 2023 19:50:48 +0800 (CST) X-QQ-SSF: 01200000000000E0X000000A0000000 X-QQ-FEAT: mRz6/7wsmIj3dfIjjNVLcgKGmUWx0z0rhG3IvarZHhF2M7vaSx63g6eOTeTaZ uHBgDLGmUrfQEdz7oHgfhMEwAOJCN6zBQMELEfoCfQ8msY6ksEOYpkzJEfVXqdH3o6kK1XT YZP/mn27FGUkoliO7GuSlhGZsJwdzwgTqCvxVGB2FdzsXiPESZqCT3m02NuvDTmw21pX11A C3LVEaiUynRo+baIxth+sDuzdG6Vi2sMehODujYsHsFOZ4hSSudBJ7naq5vzeugs9Tkw6ny Qad89TXcK5NDGUXxL2zsY3mW60k0dHThvcM9wMjuT820x8NdOZavjbPiR0aI0+alO+aLLLR +7EFmGWVBzpxCdGpYA7P+mmkfsSt1t8D75zBfWkL59u6EQIC3pvrDWUbB0//k2qLOQG0TNr X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10404998446730890993 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, tanyuan@tinylab.org Subject: [PATCH v5 7/8] selftests/nolibc: allow customize CROSS_COMPILE by architecture Date: Thu, 3 Aug 2023 19:50:48 +0800 Message-Id: <8d7f208be1b85528114ead3b63aeb954371a996e.1691062722.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:qybglogicsvrgz:qybglogicsvrgz5a-1 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Some cross compilers may not just be prefixed with ARCH, customize them by architecture may simplify the test a lot, especially, when iterate with ARCH. After customizing this for every architecture, the minimal test argument will be architecture itself, no CROSS_COMPILE required to be passed. If the prefix of installed cross compiler is not the same as the one customized, we can also pass CROSS_COMPILE as before or even pass CROSS_COMPILE_. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index ec290cd82e21..6e34d364a177 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -55,6 +55,12 @@ IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi IMAGE = $(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) +# CROSS_COMPILE: cross toolchain prefix by architecture +CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH)) + +# make sure CC is prefixed with CROSS_COMPILE +$(call allow-override,CC,$(CROSS_COMPILE)gcc) + # default kernel configurations that appear to be usable DEFCONFIG_i386 = defconfig DEFCONFIG_x86_64 = defconfig