Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7413692ybi; Mon, 8 Jul 2019 21:28:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwrT1RJSN3d1usAs5CqFOPsQm6+eQ7wHiqyfN2Ljkidn09yqYG51kKTXlxdAjRb7KTzcCu X-Received: by 2002:a17:902:bc83:: with SMTP id bb3mr30069413plb.56.1562646492162; Mon, 08 Jul 2019 21:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562646492; cv=none; d=google.com; s=arc-20160816; b=xj4L9J0BNLql15wqTzRfRbsLt9aW1OMk/sT4C4zp+JLCC1AQMa+DFaFAvwVak3EF6s ItKvz8eiudiCXqbOFiFEdIQztmtbxXlbQ9uq8jrhKlbv3irqwwk1MVP6hH9Q3aNy3CoW NK+JOKtfk3ufI9Xg2mOElJc2glcySafnqkb8zx70oJG8K8t302adT58ozmNVmoTPhL/Z EpEK+AREbNWEF0qheiK6m122Gnjg/ksMMWzgyCFtZINSBW5xngAkQi2v9T2xdF8gzemB BffHgkosLsn8Qe8XDsQiQI8CAjiXreRlMV189BMn6IAz9oLW2Io2MrndCJg9MJ7axcPE NVNQ== 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=65qATP3r4DXqcauZnw/DiveAPOtcG5uX+EGbDl+x5RQ=; b=s7nZ4UZPT9dcgJQwL43UltvutrgE0B0ypteW1f++NUjteLRVB35vd7dfudPBRj16H9 jWhX3zW55hEkdAT0QEMg/yd08eAZi84jIYxfU18Y2TArvMzq325eOgPYLVidMPs6pquH LkjL5MAj02MH6h9u9kAJnSvNQYAM2xLh9tsj0qoXe7MyvCnsbMORESVaaHSU+/qMq5Te 8uTj0yWHg0jZ4S8J5MlTkIL3r4DmY8diVboy0h+imjPjjJJySl16a0JcB3qzVURxpbn9 +kgBf3Leieo0geJJhPbplBs8d2UNukooe0P1NxFf9ZL3FUn6k5NfSerBaP/UiTgaImXB BoDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dxO7Tl84; 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 p44si2111583pjp.0.2019.07.08.21.27.56; Mon, 08 Jul 2019 21:28:12 -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=dxO7Tl84; 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 S1727613AbfGIE0W (ORCPT + 99 others); Tue, 9 Jul 2019 00:26:22 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:42158 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfGIEZm (ORCPT ); Tue, 9 Jul 2019 00:25:42 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x694OqVq009969; Tue, 9 Jul 2019 13:24:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x694OqVq009969 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562646299; bh=65qATP3r4DXqcauZnw/DiveAPOtcG5uX+EGbDl+x5RQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dxO7Tl84MEUcbZZOPxR6MrDUMh+K9tBQYUbUVWDakXdcZMK8U2fxyVmNIS4rLjN05 Q3h6Orm4aVEf89XwvMBbCieP2prZQ99bc4gp/CU8sdyNa1Xl1ro3b2HHPXZJevi7DT SuvWn3dY0zZ7/6h059uSng0gbQdauW0Ci8FmUezKBIIphWRBLcn9YYoluolpyf2jJ3 uLTMXPSR++z0EXTCrwglQ+9KlG0+JGnI30bWsvlGz0ALNc5jHe102DDJmBIRSH0pu0 SqYk7CSeK/KkTf0ErPIf8bZ+P8hojYS6FyXqt0kYLTny0hXQfoMJNSSaEddsrxknLY cfT2mIVZZEppQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 07/11] kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod Date: Tue, 9 Jul 2019 13:24:11 +0900 Message-Id: <20190709042416.27554-8-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190709042416.27554-1-yamada.masahiro@socionext.com> References: <20190709042416.27554-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 --- scripts/Makefile.modpost | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index fec6ec2ffa47..2ab1694a7df3 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,10 @@ 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 +modules := $(sort $(shell cat $(modorder))) # Stop after building .o files if NOFINAL is set. Makes compile tests quicker _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) @@ -84,7 +85,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 -- 2.17.1