Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5968670pxb; Mon, 14 Feb 2022 11:58:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF/YAgROpBp1W/91AQ9nbzgOFkAhQjBrkrAmR/t+h+wZzwPvRmBtZQfnoPyQFpQl6tWtU4 X-Received: by 2002:a17:902:8f92:: with SMTP id z18mr468092plo.42.1644868680152; Mon, 14 Feb 2022 11:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644868680; cv=none; d=google.com; s=arc-20160816; b=oNPz7mYuNvalum8YlfH9GQjPeeJlSAvQg9W/U/BgD5WybQdrBcXYXnQUrBaO4TXgcb ZJqdLrqd8ZidAHE9Fjhr6vU5vQMGCYpDz9zsgVsZzSxglJ5ixo+XQr+8np6hG1A4wps+ giTEqN1Pe4sU7HLoDIREfWvScgspzWPzlpugVcbvLTdsTAGvADgjhwc6PlgXh61uX9wS 1PTmorIfsOzKs66nCjpQd1lnV4I18Szu6xst+lOsgZ+ikXzc7pyOmzqnNNBwpdgATOgV /8Dps/Gl+WWpGugqdMjUMLi7kZedmIPdmbgpLECZi4gynjYuxFvdnOK+kjaHXvhgFHsP LY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=5VgrjCXUKaa3vtEvoj9fiH9AeIwFKrvi7im0gpAkIWk=; b=cdEgJH93Sy9O2t9KzRbXbhABqlTpsBUCJWGXTnckzOHebzoX67NSebeNVG2QdKVTHe 3bByJi9b4JOxMjD6gR9y61FgunUnVPLqgWCQbTfdIbLFssq0F2pCmYLIXHhfgvgfHg5N ye2rjtOTJ+kvqFVnDLy7i1r2OgSfoIp8zO/X66RF+HRSPqAyjCsoRnnG4GE3Yjli8Vgx UpnghcqH/pOx7PWvcG1+fArehBFEJ2ACepqbeRWHt2bTtE4wKSb7im4QIGCiPWAqlL1Q cJ9wHdtATV34dchXYj47rcDSxSXMzmYNTa/euCkGJd/+yeFUYoQvOPA7x+4n4C8s3Ytq DPDw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y62si523519pgd.723.2022.02.14.11.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:57:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 937B213A1D2; Mon, 14 Feb 2022 11:39:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348625AbiBKJaJ (ORCPT + 94 others); Fri, 11 Feb 2022 04:30:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbiBKJaJ (ORCPT ); Fri, 11 Feb 2022 04:30:09 -0500 X-Greylist: delayed 97042 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 11 Feb 2022 01:30:06 PST Received: from tkylinode-sdnproxy-1.icoremail.net (tkylinode-sdnproxy-1.icoremail.net [139.162.70.28]) by lindbergh.monkeyblade.net (Postfix) with SMTP id D049FE18; Fri, 11 Feb 2022 01:30:06 -0800 (PST) Received: from jleng.ambarella.net (unknown [180.169.129.130]) by mail-app3 (Coremail) with SMTP id cC_KCgA3_0AYLAZiLBUPDQ--.37008S2; Fri, 11 Feb 2022 17:28:00 +0800 (CST) From: 3090101217@zju.edu.cn To: masahiroy@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Leng Subject: [PATCH v2] kconfig: fix failing to generate auto.conf Date: Fri, 11 Feb 2022 17:27:36 +0800 Message-Id: <20220211092736.7623-1-3090101217@zju.edu.cn> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-CM-TRANSID: cC_KCgA3_0AYLAZiLBUPDQ--.37008S2 X-Coremail-Antispam: 1UD129KBjvJXoW7uF17uFW3Kr4kCrW8urykKrg_yoW8Jw1rpa 1Yq345GF4UJF1fCayUJas7u345G3sag3ySgas0vw1xAr1Ikr40k39IkryFgFs8WrZ7JrW5 CFWFgFWfGw47AaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBSb7Iv0xC_Cr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4vEwIxC4wAac4AC6xC2jxv24VCS YI8q64vIFxWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwAKzVCY07xG64k0F24lc2xSY4AK67AK6r4fMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI 42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z2 80aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUxWSoDUUUU X-CM-SenderInfo: qtqziiyqrsilo62m3hxhgxhubq/1tbiAwQRBVNG3FHYyQAGsc X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 From: Jing Leng When the KCONFIG_AUTOCONFIG is specified (e.g. export \ KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated. Signed-off-by: Jing Leng --- scripts/kconfig/confdata.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 59717be31210..974a079e8901 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -994,14 +994,19 @@ static int conf_write_autoconf_cmd(const char *autoconf_name) static int conf_touch_deps(void) { - const char *name; + const char *name, *tmp; struct symbol *sym; int res, i; - strcpy(depfile_path, "include/config/"); - depfile_prefix_len = strlen(depfile_path); - name = conf_get_autoconfig_name(); + tmp = strrchr(name, '/'); + depfile_prefix_len = tmp ? (tmp - name) + 1 : 0; + if (depfile_prefix_len + 1 > sizeof(depfile_path)) + return -1; + + strncpy(depfile_path, name, depfile_prefix_len); + depfile_path[depfile_prefix_len] = 0; + conf_read_simple(name, S_DEF_AUTO); sym_calc_value(modules_sym); -- 2.17.1