Subject: Re: More config changes, for ro source tree and disjoint build trees
To: None <tech-kern@NetBSD.ORG>
From: Guenther Grau <s_grau@IRA.UKA.DE>
List: tech-kern
Date: 08/14/1996 20:32:36

>   1) You get some bloat, because those bits of support code are always
>   included instead of #ifdef'd out if the option is absent.  There is
>   also a speed penalty, because of the added flag checks.
>kinda.  gcc will optimise out code that looks like
>int foo = 0;
>if (foo) {
>        ...
>so it will only be a lose if you define the various compat options.

matthew green <> and some others wrote, that a compiler
might be able to optimize this away. While I do think that this might be
possible, the original message from Mike Long implied that these bits
MUST NOT be optimized out, otherwise the LKM won't be able to work.
That's at least how I understood his mail. This is the latent support
for the LKMs that must be in the kernel, if it should be possible to
support LKMs at all. For example:

Kernel code:

if (compat_freebsd) {

If the LKM compat_freebsd is loaded, it sets the global variable
compat_freebsd to 1, if it is unloaded it sets the value to 0.

I think that these stubs are not a great kernel bloat and should be
tolerable in all kernels. This would make all kernels able to load LKMs,
without any special treatment and is a ajor step towards a leaner kernel