Failed build on randconfig for DVB_DIB modules

From: Steven Rostedt
Date: Tue Oct 26 2010 - 00:16:47 EST


I'm currently finishing up an automated test program (that I will be
publishing shortly). This program does various randconfig builds, boots
and tests (as well as bisecting and patch set testing). But enough about
it.

I hit this little build bug that is more annoying than anything else. If
I have the following configuration:


CONFIG_DVB_USB_DIBUSB_MB=y
CONFIG_DVB_USB_DIBUSB_MC=m
CONFIG_DVB_USB_NOVA_T_USB2=m

It fails to build with this error:

ERROR: "dibusb_dib3000mc_frontend_attach" [drivers/media/dvb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!
ERROR: "dibusb_dib3000mc_tuner_attach" [drivers/media/dvb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!
ERROR: "dibusb_dib3000mc_frontend_attach" [drivers/media/dvb/dvb-usb/dvb-usb-dibusb-mc.ko] undefined!
ERROR: "dibusb_dib3000mc_tuner_attach" [drivers/media/dvb/dvb-usb/dvb-usb-dibusb-mc.ko] undefined!

Those undefined functions are defined in
drivers/media/dvb/dvb-usb/dibusb-common.c, but are surrounded by:

#if defined(CONFIG_DVB_DIB3000MC) || \
(defined(CONFIG_DVB_DIB3000MC_MODULE) && defined(MODULE))

Which Mauro updated in Dec 2007 with this commit:
4a56087f3b7660c9824e9ec69b96ccf8d9b25d1c
due to just having CONFIG_DVB_DIB3000MC not enough.

Well, this is not enough either. Why?

On build the object dibusb-common.o is built first because of the
DVB_USB_DIBUSB_MB being builtin kernel core. Thus, it gets built with
the preprocessor condition false.

Then when the compile gets to the modules, the object dibusb-common.o
has already been built, and gets linked in as is.

We end up with the functions not defined and we get the above error.

My question: Why does that preprocessor condition exist? Can't we just
build those functions in regardless?

-- Steve


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