Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8201964rwp; Wed, 19 Jul 2023 06:43:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhrnChoUK7LsRr9B2AizxWmH7XPeHKwlFgETw88uLJiU4+A1GXZ+p504ZUcC6XjCX2UoQ2 X-Received: by 2002:a05:6a00:88e:b0:67a:b045:e295 with SMTP id q14-20020a056a00088e00b0067ab045e295mr2778978pfj.0.1689774235027; Wed, 19 Jul 2023 06:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689774235; cv=none; d=google.com; s=arc-20160816; b=cT9vk0CQ5N7hOr4DUI1iFARh8rsrPjHkLEwDdOCe8LRu+FF7XWkE0DyA7aYJAV+TAH t3kFIpBbKa1gfrWOB07Yt0pFGJDXDrBt1vyBDtE8u6wJUb7oIUyFxDvJniO0tPsi1edl Kd8J6SWo/vhSYOO6348IJpTMBzzVR1ebeu0cxqyn0ecmm851VsXEs3NaKuEjQeiCybA4 5OYJagltT7/lC9R3Py608y2e94JUnL+4LIDvn0sRWkqGBTp3gBZ9uqi4QrnPCUBaDSI6 l7Zg4OPjAFF4SVQMTdkA9JQMv8KTEBz8ejeaa6UXyBZbGRJjvu+UeSz9ryjC4w5G4c5N 1MdA== 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=tno37Q4lGRrf7hdtvrPm19HhrD3KEiFjkH//cRkTChM=; fh=LUnDCxFG3oyWlcYTkiNww5x4+0V5pkm51/GfDl61ZDU=; b=WlorI5Q4eJoDW5xv+TeNEWi4+kEFH4EfmXVqWTDVhYq4EqiOtqaiPmWJCKmHSMujTs B41EFk0oVEWJZh7Amyrc3Ohq0O8Ht9PUybvaTtIWV3gRHXkBM/lMu36a46upmET6+uAa RUr2Li9LICaPoY7DCVujLHcISthlysdH70E8bfONBVo7X/88J/xOSOO4xqXhLBFJysSR Do5JbFGNkxsWd2oIZm98jpZatERYPKuzzeKmieqPy5NgX+gqkRVfEZQ9AK3eC+0iFeZ7 1CBiW3L+EFiS9ExlPxBfwOj4E6RQTalh/m5tugv8trx4fCY+TFA48GzPrDLSIQoGAANG jV8g== 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 d14-20020a056a00198e00b0067c2b7b23e3si3495684pfl.345.2023.07.19.06.43.42; Wed, 19 Jul 2023 06:43:55 -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 S231154AbjGSNVp (ORCPT + 99 others); Wed, 19 Jul 2023 09:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSNVo (ORCPT ); Wed, 19 Jul 2023 09:21:44 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B973C10FE; Wed, 19 Jul 2023 06:21:40 -0700 (PDT) X-QQ-mid: bizesmtp82t1689772890ty9q7xay Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:21:29 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: r7EP/KuzAv8EqZ+SJffUfZBdMtI1nkzgD6ro01hnSaF51Og9hAgW29XL4W3Al ppLr/GYJVVlMZk7h+6fi7kR8pA/JLEFOAyDlqpuOUHwDRhBXzrLNE64VeS3PKfvvpI6CXeJ 0kydvZH/SrharXA9Is+1UoB0kDNPtcU9IZ36DHV56Yl9QQIO7jLRP7/+kG1g3HZyU9DA37d CFf4o578Az9IohYXlkq6VPqkoq9dAub/t2ecSak3ZtRBT4Vqy08XgRCMzMnlCMof+ZnZVZ5 nWrXfEMPHmL2NoZ2fNT8daNO6A+WpSt1HgsGrOzQ58k0rMFM4HjGzEbYckfHOYgf/7K5v7S 1ucwJoO6g8uX3y3oLmf+/SdTsKnS8NsAtBzZxKN4hA2E9qMwMr53ku+fazOTMo1POppaGTZ X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12083779158113029408 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 04/14] selftests/nolibc: fix up O= option support Date: Wed, 19 Jul 2023 21:21:24 +0800 Message-Id: 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index f1c8e4a0f1b2..058e7be070ea 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) @@ -193,14 +196,14 @@ initramfs: nolibc-test # common macros for kernel targets MAKE_KERNEL = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) -KERNEL_CONFIG = $(srctree)/.config -KERNEL_IMAGE = $(srctree)/$(IMAGE) +KERNEL_CONFIG = $(objtree)/.config +KERNEL_IMAGE = $(objtree)/$(IMAGE) defconfig: $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare extconfig: - $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) + $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(objtree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) $(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig kernel: initramfs -- 2.25.1