From patchwork Thu Aug 3 14:45:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 130704 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1245442vqx; Thu, 3 Aug 2023 09:01:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGmkpi+V2F8IqoHA9Ep570nYLY8EcDgF/+3ck6VvLRAxP+YTbUTKiVbC9vCwlSTbel/42s7 X-Received: by 2002:a05:651c:14a:b0:2b9:acad:b4b2 with SMTP id c10-20020a05651c014a00b002b9acadb4b2mr8553194ljd.6.1691078493831; Thu, 03 Aug 2023 09:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691078493; cv=none; d=google.com; s=arc-20160816; b=tfu6/Wi4sgSwOWcBJSO7lxpuSdBHc497VW23ctA1GHmyUVyMD1qM8/JhmLWHtJ9r/J brdrx9VzKRrqL8ro67GL0axEE2Q2UYksMAk4WPmVf+lNutb9cilpoIBCd7wBSGkDSXDF RstFNT9VIMGOGOrSoFSAf7Mihxp4GUQGbxXMuy6AV9VPZ+XDkwwVD/fO2LfzXWW2rLpJ ocaiOWvVg04RzEyIqvXTbucrozA1vDIs5ipknEiVm4OJDJrQDDW6z22ROLEDPF+vlMyq vDK4PQNrxIXA1LCodd1UVl2RtG5AwbNSYF42G8Rme79ZFUFFpZTHnnBZTbwgoTu7/J9e Y8lA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a17090619c300b00992e90ca00dsi18755ejd.16.2023.08.03.09.01.07; Thu, 03 Aug 2023 09:01:33 -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 S235924AbjHCOqS (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773224323075391188 X-GMAIL-MSGID: 1773224323075391188 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