Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2043495pxb; Fri, 5 Mar 2021 06:12:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWAq/cjDd4vsQAg2Ngv3mTfWd5mOWvki7R0Ss05FO3DcM80DNqItLiYsAeyRTryZiloPuS X-Received: by 2002:a05:6402:51d4:: with SMTP id r20mr9272514edd.112.1614953552131; Fri, 05 Mar 2021 06:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614953552; cv=none; d=google.com; s=arc-20160816; b=RIQqcXMpshO3uYfjzgzgvAtOneKqKoVI3Iwy+4SRzcCDY1bVamP+y4TqjIFaUpe3uR J6rTa1ot5d7fWSTuNrGhlI7A63isCB1z9RPe936AER4YRDrLHStZpAJGoZp2RpnA4YOy 6NXj4ib63DcguPjXsbuqvrWmELb9SJ58iToAh6dnYwGzLdGkPUpw5+gPTOuzQ7BOgyoP Hjhg5y5ZHraSWswaSKr0EiPV7NWMpwLZaVE2Mwi4KJ3leVx4LCQPIfLGkNBehzU4+Cl+ X6U6wpgyhXKPV0f5bDwH5ETxWEajDRUILz46A7wpmGeKCdEKyCOmJlXHL5EE8LghQet2 OWDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=YisVUCmZTC9e2VVOu2yqZImKgFhtwkVtxj+3MTIBfxc=; b=CIR1VmpuFbW8gRHndTtLMWR+2zHumnHr1V5Imd8QYIKlj7PcqX64tY7225upL9AyQo zBam7BrtEz8S/FFPjKhShpYu2ZX6zzMQkxYWJ4qXWRD5K0SorSKokZ6iAKPf0KlDqRWS mTY2AU+i+JfpSX82GIlbpjij85pdN7nStrfdYWu0Lg/Kl3oo36C6YQHWg/4sQC4jrqbc kWCa0gdHYZbTvL8twfjenk1v6/bWn4HmSEwDMoTagV6jP63ksI9szRbGJxBHgmeBUmzk EHXO1+xoyawgK7mCb5qmLwy3bpqJtz8NLaq0oO3PzKVfeWihqOHL0CXSAXzLw7/LTsrN 9mdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dJ2unGbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si1353284ejy.617.2021.03.05.06.12.09; Fri, 05 Mar 2021 06:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dJ2unGbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbhCEOJR (ORCPT + 99 others); Fri, 5 Mar 2021 09:09:17 -0500 Received: from conssluserg-05.nifty.com ([210.131.2.90]:40610 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbhCEOJN (ORCPT ); Fri, 5 Mar 2021 09:09:13 -0500 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 125E8hRh007163; Fri, 5 Mar 2021 23:08:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 125E8hRh007163 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1614953324; bh=YisVUCmZTC9e2VVOu2yqZImKgFhtwkVtxj+3MTIBfxc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dJ2unGbGIFCfGxCzt7OE7S7x593Ip03sDfRHJb06fQiorDTrxXrTDxuAovbjcW5bB 4r1VXBCw5A9j5v1/9cedj0gX5lUzKVhxXEyNWxJF/iFHmTV1dtdOgEDyOi4j9NibYA wUzT+osFnrFP6GNKfCbe159RBl8SKYXYRe53jYUMTXnZw2AZiiZwpBgDHyon0ZEbc5 /7jw9vsKLi7HNmg214Cjl2G8FDuV9RYkbmhuZC53HRSxhk4bn/6JEPT0WmrqyI1fHs abEhH3Ar5TBEr/OcQ8ndS8C3JZVG6cwTephRnR3hl6N7AVzE8FldvB7HH121z3zuU1 tNvCH1qyBs1wg== X-Nifty-SrcIP: [209.85.216.46] Received: by mail-pj1-f46.google.com with SMTP id bj7so2092092pjb.2; Fri, 05 Mar 2021 06:08:44 -0800 (PST) X-Gm-Message-State: AOAM530mgqsZAnDVb7aDtTxxebKfLx0kG7PJkRxlX58QQ2u2LIFhZUbA PSceqdJIhEprACUruhbs33ODKuFZH7wbf1ciutQ= X-Received: by 2002:a17:90a:dc08:: with SMTP id i8mr10071823pjv.153.1614953323469; Fri, 05 Mar 2021 06:08:43 -0800 (PST) MIME-Version: 1.0 References: <20210305100212.818562-1-linux@rasmusvillemoes.dk> In-Reply-To: From: Masahiro Yamada Date: Fri, 5 Mar 2021 23:08:06 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: apply fixdep logic to link-vmlinux.sh To: Rasmus Villemoes Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 5, 2021 at 10:50 PM Masahiro Yamada wrote: > > On Fri, Mar 5, 2021 at 7:02 PM Rasmus Villemoes > wrote: > > > > The patch adding CONFIG_VMLINUX_MAP revealed a small defect in the > > build system: link-vmlinux.sh takes decisions based on CONFIG_* > > options, but changing one of those does not always lead to vmlinux > > being linked again. > > > > For most of the CONFIG_* knobs referenced previously, this has > > probably been hidden by those knobs also affecting some object file, > > hence indirectly also vmlinux. > > > > But CONFIG_VMLINUX_MAP is only handled inside link-vmlinux.sh, and > > changing CONFIG_VMLINUX_MAP=n to CONFIG_VMLINUX_MAP=y does not cause > > the build system to re-link (and hence have vmlinux.map > > emitted). Since that map file is mostly a debugging aid, this is > > merely a nuisance which is easily worked around by just deleting > > vmlinux and building again. > > > > But one could imagine other (possibly future) CONFIG options that > > actually do affect the vmlinux binary but which are not captured > > through some object file dependency. > > > > To fix this, make link-vmlinux.sh emit a .vmlinux.d file in the same > > format as the dependency files generated by gcc, and apply the fixdep > > logic to that. I've tested that this correctly works with both in-tree > > and out-of-tree builds. > > > > Signed-off-by: Rasmus Villemoes > > --- > I moved the code to the last line of scripts/link-vmlinux.sh, and added a comment, otherwise, the intent is obscure. diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 7d4b7c6f01e8..e9516bdfcc6f 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -422,7 +422,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then fi vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} -echo "vmlinux: $0" > .vmlinux.d # fill in BTF IDs if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then @@ -451,3 +450,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then exit 1 fi fi + +# For fixdep +echo "vmlinux: $0" > .vmlinux.d -- Best Regards Masahiro Yamada