From patchwork Sun Jun 23 16:13:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11011777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0762F76 for ; Sun, 23 Jun 2019 16:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB52128ABE for ; Sun, 23 Jun 2019 16:13:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF7D028AC6; Sun, 23 Jun 2019 16:13:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B45D28ABE for ; Sun, 23 Jun 2019 16:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbfFWQNi (ORCPT ); Sun, 23 Jun 2019 12:13:38 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:23058 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfFWQNi (ORCPT ); Sun, 23 Jun 2019 12:13:38 -0400 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-09.nifty.com with ESMTP id x5NGDU0w024279; Mon, 24 Jun 2019 01:13:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x5NGDU0w024279 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1561306410; bh=jqiQ1y5oNfRR0g7lME/nEDNqOJEW6bjlbalGJ20HGQ0=; h=From:To:Cc:Subject:Date:From; b=xDxG0siw4cbp7po2wAgeT49KgFRCeqsPlrhZEwuZggbYGoHPmGabUijA79H8aOPgE 043ZeuEXYhloNDl93C987jGila8l9k6Y/w8ggnmssC4Bi84UxraxZcDh3fE+dD9Sqc 3gMDLiFYOK7Go3ya81r/l+RVnLl614U3qJI0IdHweL8YBZ0WY6mgyKwjGEM0fK0L9i T+kBWj4+seEbUFVV7O8kBFQ6/2B1yknD4ywlPF1PVT4OJ5Q0z6BE/XcwPEtSl6Y+9Y GplBE7YI11RrvZollgtMH3zvUysZa23pN6m++1tg+gNrJ90BOOB9Z0srA1pN6yea+F Wf5HvEaiFhrZg== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Date: Mon, 24 Jun 2019 01:13:27 +0900 Message-Id: <20190623161328.22461-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike modules.order, modules.builtin is not rebuilt every time. Once modules.builtin is created, it will not be updated until auto.conf or tristate.conf is changed. So, it misses to notice a change in Makefile, for example, renaming of modules. Kbuild must always descend into directories for modules.builtin too. Signed-off-by: Masahiro Yamada --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9514dac2660a..19c33bc69bb1 100644 --- a/Makefile +++ b/Makefile @@ -1289,12 +1289,16 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh -modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) - $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin +modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs)) -%/modules.builtin: include/config/auto.conf include/config/tristate.conf - $(Q)$(MAKE) $(modbuiltin)=$* +modules.builtin: $(modbuiltin-dirs) + $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@ +PHONY += $(modbuiltin-dirs) +# tristate.conf is not included from this Makefile. Add it as a prerequisite +# here to make it self-healing in case somebody accidentally removes it. +$(modbuiltin-dirs): include/config/tristate.conf + $(Q)$(MAKE) $(modbuiltin)=$(patsubst _modbuiltin_%,%,$@) # Target to prepare building external modules PHONY += modules_prepare From patchwork Sun Jun 23 16:13:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11011775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE1C41398 for ; Sun, 23 Jun 2019 16:13:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5B7128ABE for ; Sun, 23 Jun 2019 16:13:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E4328AC6; Sun, 23 Jun 2019 16:13:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EA2328ABE for ; Sun, 23 Jun 2019 16:13:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbfFWQNi (ORCPT ); Sun, 23 Jun 2019 12:13:38 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:23057 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfFWQNi (ORCPT ); Sun, 23 Jun 2019 12:13:38 -0400 Received: from grover.flets-west.jp (softbank126125154139.bbtec.net [126.125.154.139]) (authenticated) by conuserg-09.nifty.com with ESMTP id x5NGDU0x024279; Mon, 24 Jun 2019 01:13:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x5NGDU0x024279 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1561306411; bh=meEmv4m9X6eizB8GzJ2MviWJJ0JI6pOOoAMXbmBaZcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QVWGkYTbzlsmLJsvT0hCaLAXrAk/ju97Hv6WYfmXhx4dz+Oj1w7YGmXDj3tXufIHT 4iWgSuaLRQ87jU2W0Z5MKumZl1tmVqr/TVzBUOj7bUdaZqI37zkpuLPJ39FNmm7AIX Z2TSsKRe5/EgQ23piXwkrvJ+6rwHYseCmSvhStrCEzsZeVgMvQlLftifzN+2SJt/5B CZf5Hr0oy92/sS7TPD0XPx3itJr1+cPR+OVE+rHaeIs8sE9zfBr/JOETG+cPztrl8j uFss/g+w5FIzXAqTbgwmhsysY9MqY1gxRwKWZtnvK5pmgqrc/0KSLweUEoom3ef5+1 /caHML3T4zgeA== X-Nifty-SrcIP: [126.125.154.139] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] kbuild: split modules.order build rule out of 'modules' target Date: Mon, 24 Jun 2019 01:13:28 +0900 Message-Id: <20190623161328.22461-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190623161328.22461-1-yamada.masahiro@socionext.com> References: <20190623161328.22461-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Merge the build rules of modules.order and modules.builtin Signed-off-by: Masahiro Yamada --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 19c33bc69bb1..6bfe22b852f2 100644 --- a/Makefile +++ b/Makefile @@ -1283,16 +1283,18 @@ all: modules # using awk while concatenating to the final file. PHONY += modules -modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin - $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order +modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh -modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs)) +modules.order modules.builtin: + $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@ + +modules.order: $(vmlinux-dirs) +modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs)) modules.builtin: $(modbuiltin-dirs) - $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@ PHONY += $(modbuiltin-dirs) # tristate.conf is not included from this Makefile. Add it as a prerequisite