kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Link an out-of-tree module into vmlinux
@ 2012-09-28 16:01 Alexei Colin
  2012-09-28 18:01 ` Dave Hylands
  0 siblings, 1 reply; 3+ messages in thread
From: Alexei Colin @ 2012-09-28 16:01 UTC (permalink / raw)
  To: kernelnewbies

Hello,

Does the build system support building built-in components of vmlinux
out-of-tree?

That is, I know that these two are possible:
(1) build out-of-tree code as a loadable kernel module (.ko) (use the
M=/path/to/out-of-tree/dir)
(2) build an in-tree module as a statically built-in component of
vmlinux instead of as a LKM (use the CONFIG_<module>=y, or otherwise add
the object files to obj-y instead of obj-m)

The question is can you build an an _out-of-tree_ module as a statically
built-in component of vmlinux?

It seems you can't do it without modifying the root Makefile. That is,
the reason (2) works is because the directory that will have built-in.o
in it is in-tree and explicitly referenced by the root Makefile. I would
hope that the M=dir parameter would effectively add the dir to the list,
but it seems that it does not, spoiling the whole party: the built-in.o
is correctly created, but it is not picked up by the vmlinux link-line.
The only workaround I have working is to add an ugly out-of-tree path
into the list of directories in the root Makefile.

I could not find this use-case in the neither in the Kbuild
documentation nor online. Thank you in advance.

-alexei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-28 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 16:01 Link an out-of-tree module into vmlinux Alexei Colin
2012-09-28 18:01 ` Dave Hylands
2012-09-28 19:10   ` Alexei Colin

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).