linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaun Tancheff <shaun@tancheff.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Shaun Tancheff <stancheff@cray.com>,
	linux-kbuild@vger.kernel.org,
	Joe Lawrence <joe.lawrence@redhat.com>,
	"'James E . J . Bottomley'" <jejb@linux.ibm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	"'Martin K . Petersen'" <martin.petersen@oracle.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Shuah Khan <shuah@kernel.org>, Thomas Renninger <trenn@suse.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH 1/1] kbuild: recursive build of external kernel modules
Date: Thu,  8 Aug 2019 19:21:04 -0500	[thread overview]
Message-ID: <20190809002104.18599-2-stancheff@cray.com> (raw)
In-Reply-To: <20190809002104.18599-1-stancheff@cray.com>

When building a tree of external modules stage 2 fails
silently as the root modules.order is empty.

Modify the modules.order location to be fixed to the
root when KBUILD_EXTMOD is specified and write all
module paths to the single modules.order file.

Signed-off-by: Shaun Tancheff <stancheff@cray.com>
---
 Makefile               | 1 +
 scripts/Makefile.build | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 23cdf1f41364..a9964492f47e 100644
--- a/Makefile
+++ b/Makefile
@@ -1622,6 +1622,7 @@ $(module-dirs): prepare $(objtree)/Module.symvers
 
 modules: $(module-dirs)
 	@$(kecho) '  Building modules, stage 2.';
+	$(Q)$rm -f $(KBUILD_EXTMOD)/modules.order
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
 PHONY += modules_install
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0d434d0afc0b..f9908b3d59e0 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -64,7 +64,13 @@ builtin-target := $(obj)/built-in.a
 endif
 
 ifeq ($(CONFIG_MODULES)$(need-modorder),y1)
+ifneq ($(KBUILD_EXTMOD),)
+modorder-target := $(KBUILD_EXTMOD)/modules.order
+modorder-add := >>
+else
 modorder-target := $(obj)/modules.order
+modorder-add := >
+endif
 endif
 
 mod-targets := $(patsubst %.o, %.mod, $(obj-m))
@@ -423,7 +429,7 @@ endif # builtin-target
 $(modorder-target): $(subdir-ym) FORCE
 	$(Q){ $(foreach m, $(modorder), \
 	$(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \
-	| $(AWK) '!x[$$0]++' - > $@
+	| $(AWK) '!x[$$0]++' - $(modorder-add) $@
 
 #
 # Rule to compile a set of .o files into one .a file (with symbol table)
-- 
2.20.1


  reply	other threads:[~2019-08-09  0:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  0:21 [PATCH 0/1] kbuild: Support building a tree of modules with -M=<root> Shaun Tancheff
2019-08-09  0:21 ` Shaun Tancheff [this message]
2019-08-12 15:23   ` [PATCH 1/1] kbuild: recursive build of external kernel modules Masahiro Yamada
2019-08-12 17:34     ` Shaun Tancheff
2019-08-13  1:06       ` Masahiro Yamada
2019-08-13 22:10         ` Shaun Tancheff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190809002104.18599-2-stancheff@cray.com \
    --to=shaun@tancheff.com \
    --cc=corbet@lwn.net \
    --cc=jejb@linux.ibm.com \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michal.lkml@markovi.net \
    --cc=shuah@kernel.org \
    --cc=stancheff@cray.com \
    --cc=trenn@suse.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).