Looking to dissect kbuild

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Mon Jan 27 16:27:03 EST 2014


On Mon, 27 Jan 2014 12:49:40 -0800, Eric Fowler said:

> I want to know more about how that file interacts with the build system. In
> particular, in situations like a build seeing a syntax error in foo.c, I
> want to trace from foo.c all the way up to every entry in dot-config that
> imports or depends on foo.c.

You have that backwards. You want every entry in .config that foo.c depends
on.

Hint 1:  For a given drivers/bar/foo.c, you want to take a quick peek
at drivers/bar/.foo.o.cmd - that's what kbuild uses so 'make' can figure
out what needs rebuilding

Hint 2: Fiven the list of .c and .h files files that a given .o depends
on, it becomes trivial to generate a list of CONFIG_* variables that are
potentially referenced.

Hint 3: It's almost always a problem with a missing declaration of 'frobozz'
or whatever - at which point 'find include -type f | xargs grep frobozz' and
then looking at what #ifdef's wrap the definition of frobozz is usually more
productive....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140127/6edfd5ec/attachment.bin 


More information about the Kernelnewbies mailing list