Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1831845rwb; Sun, 6 Aug 2023 04:09:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpn6+3NERf/L59tBBPucL9H6PecynIqrPOolB19VhT5ZPHbMMVB3tTr0bZJGsXSH4faZhT X-Received: by 2002:a05:6a20:138e:b0:126:f64b:6689 with SMTP id hn14-20020a056a20138e00b00126f64b6689mr5601383pzc.12.1691320193022; Sun, 06 Aug 2023 04:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691320193; cv=none; d=google.com; s=arc-20160816; b=hZ76EHqHraOta6x/84mBZWgIQUTF4X/MkhYo3DGTM4VVfzqnU3ZoFsNGYYUdBjhm4z WQjpADEw8p7++JVB8euYIFh8vFqU/K3al84zihM2rp3KYdp77FuJVzDwTPhiz07Urbe9 yKTl0eJQX72ffa4olt33r0V8C9sTWisEASRgN9NQPu2eRPtTbIg60CSBIRWGU9kx/oP4 nSitdlrTzMmPvdGoOAPJTn/PyLSvyF/XAbDGrCC5ecvBEPMBBoLRVYR6C5cutPezBCGE Z8YZpUxFTggvVB1zAfMNAsxgH+Zci7PmMsoLRfITmzyyzG4mzLae/SQ0Cq+pY8/pSCls qyJA== 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=g+3vBNFrq7UL5GG72XlyXcTyr4RQ1k3+h9Rd9v8tsOA=; fh=/vS2sZUuhma2kdLIF5OIZVjw0sPbMnKegco7d7tPfD4=; b=dXRkzclkTi9rwQPrVxOcs0YklcHyzLl19C3r+f91ebOymMuFxuWXXBkbAxIi+t81Tr 6S0aaJG2OD81UvOzeAMNP2NJ5+DWgyspWzRA1iDN3WaoQa//hHmfCZRudM5Bzt/SO+OO 2+t7pO1AD5JS4WSVg/xg27KocR2qCH9GJr8thzfp2I3isv/TOV/K3lz0TC2lKKdBFDiG tEID138RdoEtw9mjGWrvZvhPlvsK+er4RpOJEbMucfPSgELwTSTfbdCtnG7YxwQZojwl M5ZExMRzgM05H2/nHTYpRDpJXlF401w+fOR86aRW9enTPFBILfk22m/2T2sO2FousngL /Jag== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i185-20020a6387c2000000b00563fce1544asi4273995pge.758.2023.08.06.04.09.41; Sun, 06 Aug 2023 04:09:53 -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 S229999AbjHFKQ4 (ORCPT + 99 others); Sun, 6 Aug 2023 06:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjHFKQz (ORCPT ); Sun, 6 Aug 2023 06:16:55 -0400 Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D64B131; Sun, 6 Aug 2023 03:16:51 -0700 (PDT) X-QQ-mid: bizesmtp86t1691316998tvucykia Received: from linux-lab-host.localdomain ( [116.30.130.12]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 06 Aug 2023 18:16:37 +0800 (CST) X-QQ-SSF: 01200000000000E0X000000A0000000 X-QQ-FEAT: zT6n3Y95oi3UNBq/05tBwfN55E8F18HQLKieo6XoWqFlFdZ4Ww8tTuCZhEv96 1J91u0seLhK/NAc69RMunx9iy5hL9Qzb2ww2dC0niCNoAcS4v/Ws10Y1PXDhlBs05jPuF/R 3lqIn4CbvtqAo/exiy3Q1hgkbZu9BldgDax85supGkDY7sNInD06V+ChRpkn3Ef7lD2PZvL GJvwM8SV+C5+6MvFdQHW+b2TajwusYHvmi59SFpW2RXroLOXmCYEa0zMgOfSeKGZnLXoeGx fkrxYNKD8lW4RkKs0Hed8IhQefR/iZJ9iyMtIpb7fz/Ogy61Tymnawu+ePGIeOjEmXnLU+k 01NPgsXhGgfMkYZODlzt5Dzf24Mtxc1jfp27BztU3nFHjRDMU48V9YAweQ7Pg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 16725939209030767129 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tanyuan@tinylab.org, thomas@t-8ch.de Subject: Re: [PATCH v6 7/8] selftests/nolibc: allow customize CROSS_COMPILE by architecture Date: Sun, 6 Aug 2023 18:16:36 +0800 Message-Id: <20230806101636.14407-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230806100410.GC10627@1wt.eu> References: <20230806100410.GC10627@1wt.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,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 It uses 'eval $(1) = $(2)' style, no real 'override' as the name shows ;-) > > But you did find a bug above, we should include it again here to avoid not > > break the possibility of using llvm (still require to check if there are some > > other regressions): > > > > include ../../../scripts/Makefile.include > > > > And I have further found there is another cc-cross-prefix helper from: > > > > $ grep cc-cross-prefix -ur scripts/ > > scripts/Makefile.compiler:# cc-cross-prefix > > scripts/Makefile.compiler:# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) > > scripts/Makefile.compiler:cc-cross-prefix = $(firstword $(foreach c, $(1), \ > > > > So, we are able to search the toolchains from Arnd's, local toolchains and ..., > > may not need to force users to use which one, I will do more tests on it. > > > > Please don't merge this patch too, to avoid break anything, let's tune it > > carefully in our v2 and delay the whole stuff to v6.7. > > OK. Note that in the end it might be less difficult to try to set > CROSS_COMPILE *before* including the general include instead of > after: we could preset CROSS_COMPILE based on the ARCH/XARCH we know > at this step, as this is not expected to rely on auto-detection. > A simple tests shows, we are able to simply move the include after our customize lines: diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 1f7c36fbe083..ed21dc393dc0 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -# Makefile for nolibc tests -include ../../../scripts/Makefile.include # We need this for the "cc-option" macro. include ../../../build/Build.include diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 228a95e65113..91a2a546954c 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 +include ../../../scripts/Makefile.include Thanks, Zhangjin > Willy