Re: [patch 2/7] enable unit-at-a-time optimisations for gcc4

From: Sam Ravnborg
Date: Sat Jan 07 2006 - 03:46:05 EST


On Sat, Jan 07, 2006 at 01:05:16AM +0100, Andi Kleen wrote:
>
> The feature also has some drawbacks - last time I checked it
> was still quite green (as in bananas). First it causes gcc
> to eat a lot more memory because it has to hold completely directories
> worth of source in memory. This might slow things down if setups
> that didn't swap before start doing this now.
kbuild rely on the gcc feature that generates a dependency file
using: -Wp,-MD,<file>
This is broken when adding several .c files.
It looks like gcc generate a new dependency file for each and every
input file overwriting the old one. Obviously caused by gcc being
invoked once for each input file in my version of gcc.

gcc --version:
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Anyone that knows how I can enable gcc 4.x for kernel builds on a gentoo
box without changing gcc for everything else?
I could install a vanilla gcc but too bored to do so.

> I suspect it'll also run slower with this because it has some algorithms
> that scale with the size of the input source and some of the
> directories in the kernel can be quite big (e.g. i'm not
> sure letting a optimizer lose on all of xfs at the same
> time is a good idea)
The most noticeable difference will be when it has to compile all files
for a module when a single file changes. And cccache will not save us in
this case.

> And gcc is really picky about type compatibility between source files
> with program-at-a-time. If any types of the same symbols are
> incompatible even in minor ways you get an ICE. That's technically
> illegal, but tends to happen often in practice (e.g. when people
> use extern) It might end up being quite a lot of work to clean this up.

Even with an ICE it may be wortwhile to do a allmodconfig build just to
get an overview of type inconsistencies - no?
A quick grep shows that we have 3300 extern functions in .c files in the
kernel :-(

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/