From: Sam Ravnborg <sam@ravnborg.org>
To: Jari Ruusu <jariruusu@users.sourceforge.net>
Cc: Sam Ravnborg <sam@ravnborg.org>, Andrew Morton <akpm@osdl.org>,
Linus Torvalds <torvalds@osdl.org>,
Martin Schlemmer <azarah@nosferatu.za.org>,
Linux Kernel Mailing Lists <linux-kernel@vger.kernel.org>,
Andreas Gruenbacher <agruen@suse.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Kai Germaschewski <kai@germaschewski.name>
Subject: Re: [PATCH 0/2] kbuild updates
Date: Tue, 22 Jun 2004 20:44:23 +0200 [thread overview]
Message-ID: <20040622184423.GA6910@mars.ravnborg.org> (raw)
In-Reply-To: <40D7C3D3.30DB5F72@users.sourceforge.net>
On Tue, Jun 22, 2004 at 08:29:55AM +0300, Jari Ruusu wrote:
> Sam Ravnborg wrote:
> > On Mon, Jun 21, 2004 at 12:03:19AM +0200, Sam Ravnborg wrote:
> > > If I get just one good example I will go for the object directory, but
> > > what I have seen so far is whining - no examples.
> >
> > Now I recall why I did not like the object directory.
> > I will break all modules using the kbuild infrastructure!
>
> No it does not. If 'export KBUILD_OUTPUT=/foo' command is used used before
> kernel is built, it is not any more difficult to compile external modules
> with that same env variable defined.
>
> > Why, because there is no way the to find the output directory except
> > specifying both directories.
> > One could do:
> > make -C /lib/modules/`uname -r`/source O=/lib/modules/`uname -r`/build M=`pwd`
> >
> > So the currect choice is:
> > 1) Break modules that actually dive into the src, grepping, including or whatever
> > 2) Break all modules using kbuild infrastructure, including the above ones
>
> or 3) Add the missing object symlink. It does not break anything.
This is unfortunately not the case.
First a few facts.
The documented way to build external modules has for a while now been
to use the following command:
make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules
Recently this was simplifed to
make -C /lib/modules/`uname -r`/build M=`pwd`
As you pointed out in a previous post letting build point to the
output directory would break all existing drivers using the documented
approach, iff the kernel were compiled using a separate output directory.
So the breakage that was of a concern was how to build external
modules using the above command - but having the kernel build
using a separate output directory.
The was solved by adding a small makefile in the output directory.
So the situation with the patch posted is that all ordinary modules
compile independent of the kernel is compiled with separate output
directories or not.
The problem you point out is modules that to be backward compatible
needs access to the kernel source. This is solved in different ways:
a) Grepping the source direct
b) Compiling a small code fragment, and test if the .o file exists
Knowing your background you are most familiar with the a) approach.
Therefore I understand why you prefer to set an environment variable
and otherwise use your current makefile.
But doing so will break all 'ordinary' external modules.
The ordinary modules are adapted to use the above commands
to compile the module.
But if the build symlinks points to the source of the
kernel and the kernel uses separate directory for output files then
it is missing the possibility to:
- access .config
- use kbuild infrastructure
- include headers under asm symlink
All the abvoe are fatal.
The porposal to require the user to set KBUILD_OUTPUT before
compiling the module would fix this. But this is then a change
in the required command used to compile an 'ordinary' external module.
It would then look like:
KBUILD_OUTPUT=/lib/modules/`uname -r`/object; make -C /lib/modules/`uname -r`/build M=`pwd`
This change is not acceptable.
The tradeoff is that external modules that needs access to the source
needs to be tweaked to support kernels build using separate output and
source directories.
So the final result is that external modules that needs access to
the source is broken iff the kernel uses separate output directories.
> > I go for 1), introducing minimal breakage.
>
> You seem to be in some strange "I must destroy... I must destroy... I must
> destroy..." mental state. There is a no-breakage alternative and you just
> will not consider that at all.
Requiring user to set an environment variable in many common cases
are breakage.
Sam
next prev parent reply other threads:[~2004-06-22 18:34 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-20 21:19 Sam Ravnborg
2004-06-20 21:21 ` [PATCH 1/2] kbuil: add deb-pkg target Sam Ravnborg
2004-06-20 21:22 ` [PATCH 0/2] kbuild updates Sam Ravnborg
2004-06-20 21:23 ` [PATCH 2/2] kbuild: Improved external module support Sam Ravnborg
2004-06-20 21:25 ` Arjan van de Ven
2004-06-20 21:31 ` Martin Schlemmer
2004-06-20 21:45 ` Sam Ravnborg
2004-06-20 21:38 ` Arjan van de Ven
2004-06-21 1:41 ` Petr Vandrovec
2004-06-21 9:01 ` Geert Uytterhoeven
2004-06-21 21:57 ` Sam Ravnborg
2004-06-20 21:30 ` [PATCH 0/2] kbuild updates Martin Schlemmer
2004-06-20 21:42 ` Arjan van de Ven
2004-06-20 21:52 ` Martin Schlemmer
2004-06-20 22:26 ` Andreas Gruenbacher
2004-06-20 22:39 ` Martin Schlemmer
2004-06-20 23:51 ` Andreas Gruenbacher
2004-06-21 22:31 ` Sam Ravnborg
2004-06-21 22:33 ` Martin Schlemmer
2004-06-21 22:50 ` Andreas Gruenbacher
2004-06-21 23:03 ` Sam Ravnborg
2004-06-20 22:03 ` Sam Ravnborg
2004-06-20 22:16 ` Martin Schlemmer
2004-06-20 22:26 ` Alistair John Strachan
2004-06-20 22:54 ` Martin Schlemmer
2004-06-21 22:46 ` Sam Ravnborg
2004-06-21 22:33 ` Sam Ravnborg
2004-06-21 22:29 ` Martin Schlemmer
2004-06-21 22:56 ` Andreas Gruenbacher
2004-06-20 22:18 ` Sam Ravnborg
2004-06-20 22:25 ` Martin Schlemmer
2004-06-21 22:48 ` Sam Ravnborg
2004-06-22 5:29 ` Jari Ruusu
2004-06-22 9:20 ` Andreas Gruenbacher
2004-06-22 18:23 ` Jari Ruusu
2004-06-22 18:44 ` Sam Ravnborg [this message]
2004-06-21 0:29 ` Hannu Savolainen
2004-06-21 1:27 ` Andreas Gruenbacher
2004-06-21 6:47 ` Arjan van de Ven
2004-06-21 8:02 ` Hannu Savolainen
[not found] <29hJN-3Jl-35@gated-at.bofh.it>
[not found] ` <29icN-42R-13@gated-at.bofh.it>
[not found] ` <29imu-4ad-31@gated-at.bofh.it>
[not found] ` <29iwc-4g7-27@gated-at.bofh.it>
2004-06-20 22:36 ` Pascal Schmidt
[not found] <539000871@toto.iv>
2004-06-22 1:39 ` Peter Chubb
2004-06-22 5:20 ` Sam Ravnborg
2004-06-22 8:36 ` Andreas Gruenbacher
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=20040622184423.GA6910@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=agruen@suse.de \
--cc=akpm@osdl.org \
--cc=azarah@nosferatu.za.org \
--cc=geert@linux-m68k.org \
--cc=jariruusu@users.sourceforge.net \
--cc=kai@germaschewski.name \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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
Powered by JetHome