[lkml]   [2005]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] Permanently fix kernel configuration include mess (was: Missing #include <config.h>)
On Tue, Sep 13, 2005 at 03:08:26PM +0100, Russell King wrote:
> On Tue, Sep 13, 2005 at 02:56:23PM +0100, Jörn Engel wrote:
> > After spending some hours last night and this morning hunting a bug,
> > I've found that a different include order made a difference. Some
> > files don't work correctly, unless config.h is included before.
> I'm still of the opinion that we should add
> -imacros include/linux/config.h
> to the gcc command line and stop bothering with trying to get
> linux/config.h included into the right files and not in others.
> (which then means we can eliminate linux/config.h from all files.)
> From what you can see below, missing includes of it can remain
> for months, and it can cause bugs which are rather non-obvious.

Well, fixing all the ARM related config.h include mess, the patch
comes out at 53K with this diffstat summary:

150 files changed, 142 insertions(+), 91 deletions(-)

I really think we should stop being crazy and apply something like
the patch below instead. Afterwards, we may optionally want to re-
educate people to not include linux/config.h after all.

Subject: [KBUILD] Permanently fix kernel configuration include mess.

Include autoconf.h into every kernel compilation via the gcc
command line using -imacros. This ensures that we have the
kernel configuration included from the start, rather than
relying on each file having #include <linux/config.h> as
appropriate. History has shown that this is something which
is difficult to get right.

Since we now include the kernel configuration automatically,
make configcheck becomes meaningless, so remove it.

Signed-off-by: Russell King <>

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -346,7 +346,8 @@ AFLAGS_KERNEL =
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
- $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
+ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
+ -imacros include/linux/autoconf.h


@@ -1247,11 +1248,6 @@ tags: FORCE
# Scripts to check various things for consistency
# ---------------------------------------------------------------------------

- find * $(RCS_FIND_IGNORE) \
- -name '*.[hcS]' -type f -print | sort \
- | xargs $(PERL) -w scripts/
find * $(RCS_FIND_IGNORE) \
-name '*.[hcS]' -type f -print | sort \
Russell King
Linux kernel 2.6 ARM Linux -
maintainer of: 2.6 Serial core
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-09-13 16:52    [W:0.064 / U:0.144 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site