From patchwork Tue Jul 9 07:14:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 168723 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8175517ilk; Tue, 9 Jul 2019 00:15:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuvrt6u2/qf+aHjhLmSO5cRzyByEW9ADU1nRzPPf5XPjkXyDaqBGoC/saqTREY3y3FPvD/ X-Received: by 2002:a17:90b:f0f:: with SMTP id br15mr31512907pjb.101.1562656510476; Tue, 09 Jul 2019 00:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562656510; cv=none; d=google.com; s=arc-20160816; b=wqJenYjv9vuMEV+zCKTq7VUlX/y3H2wFSKTa8wFm5H0s8eKSapGLybPTt2WCW70Evh zjvYL9w674Psc6/ICtObqRZH9OoFAf87qH6h4bR23lSDJeDvLs2Sfg06Da7pPoRgy3pp ZlfrAlck5ssmEjzimClR2+K/C3X/PrWnIHmr6GGE4fJEwaDo3zz70hnUCVm+EjzM7Kc0 ULVb0iWq8rdMtCy4KEmM1Vga5G7XDaoLstCUeQZJnAOqPcb45HmOf3LuSqu4TpaSyyXp 8WtaD0B6A9JRwiN50UW0sN7ReobouFlhwVaU4rEyaZ8WCsWX9XjmS99wF32zT55af9QF MNnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=0tb2WfkcAoePIPurQ/sqmPHgIwP8421Q7FxdbjzURyo=; b=ynd0ej3kc4pMhOSXicm51cjWts6CVTIes59ubNaPya4UJWuxzaIamtmHRMp6bJsdRl 5Gn3SxbmdInf92mywAioADouQDNaFPkD3YC1wg/WvBmo9sVNe9lKxDt12dXGIgs1NqFH Awxqev8V+PdPTh30nq2AhmwwlslBa9ITGyEDbnCtyyjapyx1q7IJ4BVcEf4H9VjtFeHE 8tFt5dMtql0mlbZYUutKM3I++jIihf67l+45cQo8aST2eVwDdfvqI8Y7UsahAl5FdiM3 yEeQ77gdt57KBDOWwHB+OXAHvQlo83ibvskh+S4Z3zb76n/otpLiPWcEoxDuLdVzz3kY 7W+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HzjW6hmk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g65si20520198pgc.425.2019.07.09.00.15.10; Tue, 09 Jul 2019 00:15:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HzjW6hmk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfGIHPI (ORCPT + 30 others); Tue, 9 Jul 2019 03:15:08 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:59393 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfGIHPI (ORCPT ); Tue, 9 Jul 2019 03:15:08 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x697ESep019286; Tue, 9 Jul 2019 16:14:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x697ESep019286 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562656469; bh=0tb2WfkcAoePIPurQ/sqmPHgIwP8421Q7FxdbjzURyo=; h=From:To:Cc:Subject:Date:From; b=HzjW6hmkzFEYcxbgep9Z5Tf5hgi9iPSB3s1e7lxHXyGcScNehXBqCl+It4S7BWTke lHUBrcjdMA+vfJE+7uBpJ/qJM5bPDo05V4boQYjT8bsfbHuTXIuZS4v8lRMUKeQQYD 6nMnrMxx1gCRduVjE7PiTc9vwAD69ByzmiRYwgvN3MhomguT51hqzUz3juEQ1mov9+ 8a/Edq1NgV3YkT9cAFaJns6bu5fmnBrMhiYZ7J2sQhFfYBJ3RWMsYlak3IXOPnJUn4 KkaAmg68QnlG0azwQPRidUPR/Uh4nwNVms7B+RP/7Wl0f/2FurKeYZPnkFS1+p5lts D6pBiuEciabKg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Sam Ravnborg , Nicolas Pitre , Masahiro Yamada Subject: [PATCH v2 01/11] kbuild: do not create empty modules.order in the prepare stage Date: Tue, 9 Jul 2019 16:14:19 +0900 Message-Id: <20190709071419.17150-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, $(objtree)/modules.order is touched in two places. In the 'prepare0' rule, scripts/Makefile.build creates an empty modules.order while processing 'obj=.' In the 'modules' rule, the top-level Makefile overwrites it with the correct list of modules. While this might be a good side-effect that modules.order is made empty every time (probably this is not intended functionality), I personally do not like this behavior. Create modules.order only when it is sensible to do so. Going forward, $(objtree)/modules.order lists the modules that was built in the last successful build. This also avoids creating pointless files: scripts/basic/modules.order scripts/dtc/modules.order scripts/gcc-plugins/modules.order scripts/genksyms/modules.order scripts/mod/modules.order scripts/modules.order scripts/selinux/genheaders/modules.order scripts/selinux/mdp/modules.order scripts/selinux/modules.order Signed-off-by: Masahiro Yamada --- Changes in v2: - inverted the logic "preparing" -> need-modorder Makefile | 4 ++-- scripts/Makefile.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 5c75ea7177f6..d8421d245f75 100644 --- a/Makefile +++ b/Makefile @@ -1076,7 +1076,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; PHONY += $(vmlinux-dirs) $(vmlinux-dirs): prepare - $(Q)$(MAKE) $(build)=$@ need-builtin=1 + $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 filechk_kernel.release = \ echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" @@ -1611,7 +1611,7 @@ $(objtree)/Module.symvers: module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) PHONY += $(module-dirs) modules $(module-dirs): prepare $(objtree)/Module.symvers - $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) + $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) need-modorder=1 modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 776842b7e6a3..e9b3d88257dd 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -63,7 +63,7 @@ ifneq ($(strip $(real-obj-y) $(need-builtin)),) builtin-target := $(obj)/built-in.a endif -ifdef CONFIG_MODULES +ifeq ($(CONFIG_MODULES)$(need-modorder),y1) modorder-target := $(obj)/modules.order endif