Re: 2.4.0-test[34]: nasty make race with CONFIG_MODVERSIONS=y

From: Michael Elizabeth Chastain (mec@shout.net)
Date: Tue Jul 18 2000 - 13:32:52 EST


I have looked at this before. I think this is a low-effort correct fix:

(1) Do what you suggest: concatenate include/linux/modversions.h
    in only one place, in the top level Makefile, after doing all
    the subdirectory "depend" statements.

(2) When compiling source files ("make vmlinux"), go ahead and make
    new "%.ver.new" files as needed. But *do not ever* copy these
    over the existing "%.ver" files. That leads to races.
    
(3) Instead, if "%.ver.new" does not compare to "%.ver", then spit
    out an error message ("your prototypes have changed; you must run
    'make dep' again"). And then "exit 1" and abort the build.

This will change some users' experience from "bad builds with no
message" to "you have to run 'make dep' a lot more". That's an
improvement. My top priority is correctness.

The real fix is to re-design CONFIG_MODVERSIONS so that it does
separate compilation. Right now, if foo.c defines a symbol, and
bar.c uses it, then bar.o depends on bar.c and foo.c. That's
evil and disgusting. bar.o should depend only on bar.c and the
files that bar.c includes (foo.h, not foo.c!).

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"

-
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/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:11 EST