From patchwork Thu Jul 11 05:44:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 168813 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10913952ilk; Wed, 10 Jul 2019 22:45:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz95sbYNZEamC7ocnmE5D2jAKO7ItRn/4/IbuH74tEjiYSX7uB7r2cJUCn/ifNzkPEJVTdH X-Received: by 2002:a65:454c:: with SMTP id x12mr2460487pgr.354.1562823956369; Wed, 10 Jul 2019 22:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562823956; cv=none; d=google.com; s=arc-20160816; b=L8IE8BNTRJGICPYCI/wCpX9Q6kA6BIkrQwnplPhPjAeAGSj3eTsKVMeSDaC9JSLI/n 4FzzB0SCBHo4PJc/wOmImzjWCIhfjnGWpGGZTpnQ7KxmpKkhPHYbLCAMuji74jRNmx9X iD7ISQez9L8RQsZzhoXViisLfNjkRwnd2NrtA4XR71QbZ7oGVUwu1buiiFd1uTJftis/ u/RzBd7yYirOquKoZLYu5Faa2Dduh4H+ldvi6kq4VZXrwqMVMlmWA3dvfGdTLaGc5e3f QnghIwyF3hW+I+yXSugpsWALpXHkIIMNEaXv1M3o1fx4aT37igZfPcjUKSYtotnnGNKK ttZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=mjkkjTnXRVjdI3ciIRz1HWZFd7z2yTHWDPrWodufX/o=; b=ZJfL29k4kcbisU88MXLSSecmlS4cZXzC/zhzHHmoc29bImDmW/blbE0/ZQMOAu6u/e ilGxUScZNmJutflaB+vXtxbQNlQFxYOSyVI0ylxXfxMzYqkwLqck/6AUnhmfSP0fxIup PwpU+4nGtUjyrY5iAvb+eKIoOZuimDe1fjvLFEmYAcvYJER26FQwfLDg+QIjPkNwSe43 O0CXj0b4NlDuETE5c6RxJ7WTROn7YyRubeONTrM1dcUQ2LCjtYqBQtyGxG5JUjpjWRuC oibfBRZzlZbIlEwCMFFuvvwBZglURt72gO5Pvhhch8qeCZ7SVP309uMk2KvD8xkLdq5r BhIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jAODMvDC; 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 d5si3803908pla.17.2019.07.10.22.45.56; Wed, 10 Jul 2019 22:45:56 -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=jAODMvDC; 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 S1728072AbfGKFpy (ORCPT + 29 others); Thu, 11 Jul 2019 01:45:54 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:59471 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727922AbfGKFpx (ORCPT ); Thu, 11 Jul 2019 01:45:53 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x6B5ip8L031345; Thu, 11 Jul 2019 14:44:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x6B5ip8L031345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562823893; bh=mjkkjTnXRVjdI3ciIRz1HWZFd7z2yTHWDPrWodufX/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jAODMvDCKfqR1Zhn7vZaIDr1Mbtv7fOKReJCqG98rha6TTAsX3wWiAChWv1gg25W8 r6Sxv0+lEkZ6VZJ30c30gqKTqg0NArc0RYsEIpt5p8cSYVpQn3Pmos6nn6KXvJhJxf ITaMDCsE1YIxfHHN0wFCEuVLsMZARh5uJMs3XIUoxQ/++Uu5X8WcHhi8yJ1B4FsWyW 3Ujk0mejbaMkFCqygqJzfrj168G2a3v9D1O9RJBbuwJFxBPATN8UUyzrMpvxqjFmbA gDWmtm80d1Y3qgfdivmIgylOveCorw2YRsKLGa1cAUtCwLiXXVpDXtsr/aqbzzhvRv 8GEcsS8bddsvA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] kbuild: do not create empty modules.order in the prepare stage Date: Thu, 11 Jul 2019 14:44:24 +0900 Message-Id: <20190711054434.1177-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190711054434.1177-1-yamada.masahiro@socionext.com> References: <20190711054434.1177-1-yamada.masahiro@socionext.com> 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. This avoids creating the following 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 Going forward, $(objtree)/modules.order lists the modules that was built in the last successful build. 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