Re: FYI: dependencies in 2.2.12 (drivers/char)

Keith Owens (kaos@ocs.com.au)
Fri, 15 Oct 1999 23:47:32 +1000


On Fri, 15 Oct 1999 08:43:55 +0200,
"Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de> wrote:
>I realized that the following objects are rebuilt, even if none of
>them has changed (and no include file neither):
>
>drivers/char/{pty,misc,console,selection,keyboard,sysrq}.o
>
>I saw It when I only had changed /drivers/char/serial.o

The recompile after changing serial.c is a unfortunate side effect of
this line in linux/Rules.make

$(SYMTAB_OBJS): $(TOPDIR)/include/linux/modversions.h $(SYMTAB_OBJS:.o=.c)

In particular "$(SYMTAB_OBJS:.o=.c)". That makes all the objects that
export symbols in a particular directory dependent on source changes to
any other source in the same directory that also exports symbols. The
real intention of that dependency is to relink modules which only exist
to export symbols defined in other sources. For example, net/netsyms.o
must be relinked when any of the net objects that rely on netsyms to
export their symbols are changed. Before "$(SYMTAB_OBJS:.o=.c)" was
added, netsyms did not get recompiled and relinked correctly.

Alas this dependency has more of an impact than required. It ends up
recompiling *all* objects that export symbols rather than just
relinking the real dependencies. To stop the extra compiles, the
Makefiles would have to define a new object type just for sym modules
(SX_OBJS?) and make the dependency rule

$(SX_OBJS): $(TOPDIR)/include/linux/modversions.h $(SYMTAB_OBJS:.o=.c)

That requires a change to all the Makefiles and nobody has considered
it worthwhile. The current rule does the job at the expense of a few
extra compiles when some sources are changed.

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