Re: corrupt modversions.h built in 2.2.13

Michael Elizabeth Chastain (mec@shout.net)
Fri, 22 Oct 1999 19:54:58 -0500


Hi Ted,

All right, you are my man for parallel make issues!

> Make the rule which creates modversions.h in the top-level makefile, and
> then run "make include/linux/modversions.h" explicitly after running the
> subsidary makes in the subdirectories (which may now be run in a
> parallel file).

This is simple and nice, but ...

There is a problem here: include/linux/modversions.h needs to be
rebuilt before compiling *.c in the subsidiary makes.

Here is the use case: someone edits drivers/char/foo.c that does
not export any symbols. They add symbols to foo.c and then change
drivers/char/Makefile to put foo.o in OX_OBJS.

Here is another idea similar to yours:

(1) Split 'make dep' into two parts: 'make dep' and 'make modversions'.

(2) Change 'make vmlinux' to depend on 'make modversions'. Actually
the parallel-correct way is: all the subdirs underneath 'make vmlinux'
need to depend on 'make modversions'. This way, the user doesn't
need to type 'make modversions' and can't get screwed by omitting it.

(3) 'make modversions' is the *only* command that *ever* writes on
include/linux/modversions.h. In fact, it can be the *only* command
that writes on include/linux/modules/*.ver, too.

This two-pass scheme would fix a bunch of other bugs in MODVERSIONS
dependencies. For instance, this use case:

kernel/ksyms.c exports a symbol
drivers/char/foo.c imports the symbol
the user edits kernel/ksyms.c and changes the prototype
make happens to compile drivers/char/foo.c before compiling kernel/ksyms.c

In parallel makes, 'make foo.o' reads include/linux/modules/foo.ver while
'make ksyms.o' is writing it, with no locking. Race!

So, what do you think of 'make modversions'?

Michael

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