Re: strange dependancy generation bug?

Sam Ravnborg (sam@ravnborg.org)
Tue, 3 Jun 2003 20:29:56 +0200


On Tue, Jun 03, 2003 at 01:07:42PM +0100, Dave Jones wrote:
> Recently (about the same time that the V=0 stuff was changed over
> in kbuild), I noticed that the dependancy generation stuff seems to be
> executed more often.

> First question that springs to mind, is why does the fixdep stuff
> get run _after_ doing the compile ?

Dependency information is always generated when a file is compiled.
The build system has no knowledge about the actual changes and there can
be changes in dependencies. The dependency generation is done by the
option:
-Wp,-MD,arch/i386/kernel/cpu/cpufreq/.powernow-k7.o.d

This tell the preprocessor to generate a makefile fragment
that includes all dependencies.
But this is not enough - a file must be recompiled if one of the CONFIG_
options used in that particualr file - or any of the dependencies - has
changed.
Therefore the second step is to run the fixdep command.
Fixdep parses all included files, and when it see a CONFIG_* symbol
it generate a dependency on the corresponding file located in
include/config/*

split-config has already updated a hirachy of files from the
active .config. When .config is changed relevant files under
include/config/* are updated. Relevant files represent only changed
config options.

fixdep is called with the commandline as argument. this is used by kbuild
to detect changes in command line parameters. If any flags are changed
this will force a recompile as well.

> Second, is why does this always happen? Even on subsequent builds.
As explained above fixdep needs to be run each time a file is
compiled.

But the real question is why you start seeing the invocation
of fixdep. I do not see it on my machine.
I asssume that you see fixdep invocation even with "make V=0".
This is a bug!

Counting this one I have now three independent reports where
kbuild displayed the invocation of fixdep.

I have tried to narrow down the root cause.
Both users were running debian unstable.
Different shells.
GNU make 3.80

I tried to install GNU make 3.80 - but I still do not see the problem.
What happens is that within Makefile.build there is used multi line
definition, where each new-line causes make to launch a new sub-shell.
The command for the second sub-shell is echoed, even though make is told
not to do so.

I have a patch to fix this that I will send to Linus tonight.

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