your change to prevent needless re-building of vmlinux.o

From: Jan Beulich
Date: Fri May 16 2008 - 12:08:02 EST


Sam,

while also looking into this issue (found time only now) I realized this is
already worked around in .26-rc2. However, it would seem to me that
suppressing the dependency on init/built-in.o altogether is likely to
cause problems in the future. Going through the version generating
logic again I realized that since vmlinux.o is always built before the first
of the (perhaps multiple, due to kallsyms) final linking stages, it ought
to be possible to simply move the version generation into the vmlinux.o
rule. And indeed, this

define rule_vmlinux-modpost
:
+$(call cmd,vmlinux_version)
+$(call cmd,vmlinux-modpost)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
$(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd
endef

with the two other invocations of vmlinux_version removed, seems to
do what is wanted.

What do you think? Am I overlooking some aspect here?

Btw., another slight anomaly I noticed is that modpost on the modules
is always performed (even when nothing changed in the tree), while
on vmlinux.o it is only performed when something caused a re-link. Is
that intentional, or just a to-be-tolerated side effect?

Thanks, Jan

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