From patchwork Wed Jul 17 06:17:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169095 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp530053ilk; Tue, 16 Jul 2019 23:18:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7i4D+05OVTXYHq7XTlXY+AxBOSbsL7+Izw9ArSFS8ZGX1oCj2jgsNPbjefgnzfpXNtF/H X-Received: by 2002:a63:d755:: with SMTP id w21mr39406990pgi.311.1563344328807; Tue, 16 Jul 2019 23:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563344328; cv=none; d=google.com; s=arc-20160816; b=N7g+OTeB/SNzk8F5yVqj5m2CacfNaTduoFvAugJlBudMTDGVF1T+zBpVjmFtpAfdJT 4B05R3Gbj6wQuDvH73JipZ3a62rBw86+SnCATH8RthD4EAn4syKU236rQS6uHQ+gSoKN Ys1X3TOdxA8AG0oK4AcdrVf3T8vMfmxqoxxBzIyXGgUBfPqmpeftDyP+CkuJkbFqWXkU XEkhk/i+3ym3gxK3pD+vwePJLlMeflSMS9cdXLeKqbKxJGU7vZ6obRapFBR13nkvha+P BTjAmuZNtJT6LTA688wUOZqlvrKwhjN8+A2J+PnLIdka4VGaBLwZ+mt7KEjGYTM6I45S 42mA== 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=a5q8HeaGgVOWSLah04ZIlj93TeQsneob5gv011FKr5g=; b=BkyLrqj58+djU/IK/R1B3e5gAQDZ5MPqHW7YjXmKU41Pr1NWbei3lRtfeJTLbKhOc1 IQJOtDa3NWaP9MjPAaLsWii5lYP+s5PTz+lB+3l5znIUWi8XYLM0LpEnPhTayUi8+AL/ 1S9Q9g8/C9OGOw8T9qThgRyzKa6YSPtlN4diTwScKifibHzFoJX5WXYy1WqaUT8dOhMo 6yjaTkZCUoNXd9rCCDwHqwDUYOUIRMvfV0B7EybipKWzhuQKywX4B4BaZMLEIAX9bmLq JDU0tSt/oyPHaMHSd5Vp3olroinL3YnoLDNPF6d1T84SI7XZ5OWfLMdDpZstXLjcvQts H7Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ViwK+Rhh; 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 y63si21374772pgd.403.2019.07.16.23.18.48; Tue, 16 Jul 2019 23:18:48 -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=ViwK+Rhh; 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 S1727552AbfGQGSq (ORCPT + 29 others); Wed, 17 Jul 2019 02:18:46 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:62972 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbfGQGS0 (ORCPT ); Wed, 17 Jul 2019 02:18:26 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x6H6I5Oj009435; Wed, 17 Jul 2019 15:18:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x6H6I5Oj009435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563344291; bh=a5q8HeaGgVOWSLah04ZIlj93TeQsneob5gv011FKr5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ViwK+RhhxDTAPBewxfuYJk5gYFRwRsxaX+ne1sXhrIpqEBY5xtAMlK5o+dKAE/kAu 62KtJxo1W4RM9sWKO9jbR2pX83+0BOX888DO7L/GTXSAMU/JApQIFrasegAlWEj47V 4/HSTg2LdJpQbo410Pp4NZSY9fgW9qk2MTLMiV+jFV1nxvOqbPMabEU+c7dwXlYoa2 Tn2cNr9V7xJddQtOyGUW2FWeNrHFUHG4sJAPSAW98JAQhjwiSTsuyx9lD7OFyij1m4 nm8W+kkMiJN9AadWMW8Ov6MsLALK6O69RFvEUTmDA/0oFqpDokqC3I8DplRBMIu6Rl og4VELHdOGC7A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v3 07/12] kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod Date: Wed, 17 Jul 2019 15:17:55 +0900 Message-Id: <20190717061800.10018-8-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717061800.10018-1-yamada.masahiro@socionext.com> References: <20190717061800.10018-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Towards the goal of removing MODVERDIR, read out modules.order to get the list of modules to be processed. This is simpler than parsing *.mod files in $(MODVERDIR). For external modules, $(KBUILD_EXTMOD)/modules.order should be read. Signed-off-by: Masahiro Yamada --- Changes in v3: - Add ifdef CONFIG_MODULES to avoid warning Changes in v2: None scripts/Makefile.modpost | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index fec6ec2ffa47..5841508ffca9 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -8,9 +8,10 @@ # b) A .o file which is the .o files above linked together # c) A .mod file in $(MODVERDIR)/, listing the name of the # the preliminary .o file, plus all .o files +# d) modules.order, which lists all the modules # Stage 2 is handled by this file and does the following -# 1) Find all modules from the files listed in $(MODVERDIR)/ +# 1) Find all modules listed in modules.order # 2) modpost is then used to # 3) create one .mod.c file pr. module # 4) create one Module.symvers file with CRC for all exported symbols @@ -60,10 +61,12 @@ include scripts/Makefile.lib kernelsymfile := $(objtree)/Module.symvers modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers -# Step 1), find all modules listed in $(MODVERDIR)/ -MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs -r grep -h '\.ko$$' | sort -u -__modules := $(shell $(MODLISTCMD)) -modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) +modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order + +# Step 1), find all modules listed in modules.order +ifdef CONFIG_MODULES +modules := $(sort $(shell cat $(modorder))) +endif # Stop after building .o files if NOFINAL is set. Makes compile tests quicker _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) @@ -84,7 +87,7 @@ MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) # We can go over command line length here, so be careful. quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules - cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T - + cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - PHONY += __modpost __modpost: $(modules:.ko=.o) FORCE