Build system runs ld more often than needed

From: Jean Delvare
Date: Mon Mar 27 2006 - 07:36:12 EST


Hi Sam,

I have noticed the following problem:

khali@arrakis:~/src/linux-2.6.16-git> make modules
CHK include/linux/version.h
Building modules, stage 2.
MODPOST
khali@arrakis:~/src/linux-2.6.16-git> touch drivers/media/video/zoran_card.c
khali@arrakis:~/src/linux-2.6.16-git> make modules
CHK include/linux/version.h
CC [M] drivers/media/video/zoran_card.o
LD [M] drivers/media/video/zr36067.o
LD [M] drivers/media/video/msp3400.o
LD [M] drivers/media/video/tuner.o
Building modules, stage 2.
MODPOST
LD [M] drivers/media/video/msp3400.ko
LD [M] drivers/media/video/tuner.ko
LD [M] drivers/media/video/zr36067.ko
khali@arrakis:~/src/linux-2.6.16-git>

See how unrelated modules are linked again?

I investigated further and it seems to happen whenever a given Makefile
has more than one composite object definition. In the case of
drivers/media/video, the following composite objects are defined:

zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o
zr36067-objs := zoran_procfs.o zoran_device.o \
zoran_driver.o zoran_card.o
tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \
mt20xx.o tda8290.o tea5767.o

msp3400-objs := msp3400-driver.o msp3400-kthreads.o

I have the following enabled:

CONFIG_VIDEO_MSP3400=m
CONFIG_VIDEO_ZORAN=m
CONFIG_VIDEO_TUNER=m

So msp3400 and tuner are relinked whenever I make a change to the
zr36067 driver.

I was able to reproduce the problem in drivers/scsi so it's not local
to the media/video area. I was also able to reproduce the problem back
to Linux 2.6.0 so the problem is not new.

Can this be looked upon?

Thanks,
--
Jean Delvare
-
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/