Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2423421rwo; Thu, 3 Aug 2023 09:08:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlEzlECm5vRT1hrP8tsWWevykqjeB7lT9e0pjE8vTzkqxII4IUw0oXIqDZFtP5NV2KcM/sir X-Received: by 2002:a05:6a00:301b:b0:686:b732:8792 with SMTP id ay27-20020a056a00301b00b00686b7328792mr22008025pfb.8.1691078920412; Thu, 03 Aug 2023 09:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691078920; cv=none; d=google.com; s=arc-20160816; b=w3oYE6NuV70176aI2SAnyfAlApWJ+1khq6Ab+4hys682br75th9nOYC2MUCNVWsOgm OyCBHxDQhzvSMSk7d/6MoVngR6qAmF1ay1Yd6Fwp49yvCRXTvtYYHhX81iAM3GktKzpy JGmWsnF5f2N1OUIHT/WqGuKmpL4mRbx1ENAQVY+FNJJXKYPeXzoVx3BNfXgZrqTnMA3F lvkUXkTPq2SQAkHZfBMeEiyfA/nR07gxBcW94nwm1C304BMl9uy0jFYpwY4R23EHVxqX Oi22rdmBUNNDhkVfN9IiFwjalAPgLe264Xq2mLGZ3UPaYASWaDm4EqSfDM/N22j6nUdt oCdA== 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=yJBSaWpPj9X/4+wKwjKpG1AzyQRibLCgN6gNsn38ZCs=; fh=TsKNe/ZSymFDLfCGQokP79s6S6Z9FKHYw1KoAUSYM0Y=; b=IpIFwq2BKtSQi0vqOrIbtg+JdbVhtkMQ8itIjHydWPDRmbiN9TBe4LaC1eTySwa8MB G7kER1cobmPXOQYqOa4nliwIiUfbgpY5gYy+ejSsg3KIos1pd30muPJ1QWnfYEpzdFQF 9w6rnJ4somWOdFWwf/kyE4FEy+BZ+pseoFiKxZ2THExjY7t7npLO46qZrR3rtxhHoPm6 uvANzgb//LR+wVrvw4q6/S6zcci+UCN+W8s1I+EZKJeyPn4yK9nNGAHRGsVQsbVWYV6B IKpCVDtAAz3R+fDhDArxZdv2O1gn+9PcgbLaWUwZXHufBy2wFoHbyJoq37NqNBJHhp52 CcbA== 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 m14-20020a633f0e000000b005645d9a89d6si83103pga.554.2023.08.03.09.08.26; Thu, 03 Aug 2023 09:08:40 -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 S236114AbjHCOqS (ORCPT + 99 others); Thu, 3 Aug 2023 10:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbjHCOqO (ORCPT ); Thu, 3 Aug 2023 10:46:14 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DB71BC3; Thu, 3 Aug 2023 07:46:09 -0700 (PDT) X-QQ-mid: bizesmtp88t1691073958thq43qfz Received: from linux-lab-host.localdomain ( [116.30.131.233]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 03 Aug 2023 22:45:57 +0800 (CST) X-QQ-SSF: 01200000000000E0X000000A0000000 X-QQ-FEAT: kUim6XnhvqW9dcd6EzLklGa12GVbNXdonLh2Hg+1w3dBPk/x2b5VmNG+MPDn6 PEFmwIR3cWR5MbUVbtIZAVws1QPogU+mUqaPc8Z5UL+wjlb/HxUYHDFDvWxvxrn7beB6YEn BJDzwZdTbH+Pnq0s4jmy5USrmMOGCTiHxvHBDfw/upU5HD5rm6FNcWY2ldr2xYwhSoB3WBs PydhNf4Gm9/FF4g1QfFcGO6D/1kY4BgUZfzgZOoFzKDqyTLkcYjUwBmT0W+0+t3inyNao0z f/vv2iK7gyd6zVCAbhLmVK+KbTNnHyFRBSR3I1RimV2DcL7oRA9h0E+76pdW21iRRQWUVYs X2PNNE2eNamVHpyeMuQ3SnFchCFW33O5RCRXPS9FqjSIWkh1GgEQMKggZnremX9J5q+j9qf pKTbbIaUw/s= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2311120515883083357 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 v1 2/3] selftests/nolibc: fix up O= option support Date: Thu, 3 Aug 2023 22:45:52 +0800 Message-Id: <759307255e4ca3b37b67321d333967a21122c422.1691073180.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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=-0.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 To avoid pollute the source code tree and avoid mrproper for every architecture switch, the O= argument must be supported. Both IMAGE and .config are from the building directory, let's use objtree instead of srctree for them. If no O= option specified, means building kernel in source code tree, objtree should be srctree in such case. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/ZK0AB1OXH1s2xYsh@1wt.eu/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 51fef5e6a152..af590aee063a 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -9,6 +9,9 @@ ifeq ($(srctree),) srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR))) endif +# add objtree for O= argument, required by IMAGE and .config +objtree ?= $(srctree) + ifeq ($(ARCH),) include $(srctree)/scripts/subarch.include ARCH = $(SUBARCH) @@ -217,12 +220,12 @@ kernel: initramfs # run the tests after building the kernel run: kernel - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" + $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(objtree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" $(Q)$(REPORT) $(CURDIR)/run.out # re-run the tests from an existing kernel rerun: - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" + $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(objtree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" $(Q)$(REPORT) $(CURDIR)/run.out # report with existing test log -- 2.25.1