On 26/02/15 16:55, Jyri Sarha wrote:
If I read Documentation/kbuild/makefiles.txt section 3.6 right, this patch should not be needed. However, without this patch the objects needed for DRM_TILCDC_INIT are not linked, if DRM_TILCDC is built as module.
I also think there's something funny either with the documentation or the kernel build system.
To summarize (Jyri correct me if I'm wrong):
We enter tilcdc directory using "obj-$(CONFIG_DRM_TILCDC)", and CONFIG_DRM_TILCDC is either y or m. Inside the directory we have the necessary makefile and code to build the driver as module or built-in. And this works fine.
But now Jyri added new piece of code to tilcdc directory, which is always built-in, even if the tilcdc driver itself is a module. So now if we enter the directory with "obj-m", and inside the tilcdc/Makefile we do "obj-y += foo.o" line, the result is that foo.o is compiled, but it is not linked either to the kernel image nor to the tilcdc.ko.
The doc says:
"Kbuild only uses this information to decide that it needs to visit the directory, it is the Makefile in the subdirectory that specifies what is modular and what is built-in."
which doesn't seem to work for us.
Signed-off-by: Jyri Sarha jsarha@ti.com
drivers/gpu/drm/Makefile | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 2c239b9..62c6158 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -60,6 +60,7 @@ obj-$(CONFIG_DRM_RCAR_DU) += rcar-du/ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ obj-$(CONFIG_DRM_OMAP) += omapdrm/ obj-$(CONFIG_DRM_TILCDC) += tilcdc/ +obj-$(CONFIG_DRM_TILCDC_INIT) += tilcdc/ obj-$(CONFIG_DRM_QXL) += qxl/ obj-$(CONFIG_DRM_BOCHS) += bochs/ obj-$(CONFIG_DRM_MSM) += msm/
I don't think the above is right. You add two rules for tilcdc directory. I presume you meant to replace the current tilcdc line with the new one?
But I don't think the new line makes sense. Using obj-$(CONFIG_DRM_TILCDC) above makes sense, and also obj-y makes sense, but obj-$(CONFIG_DRM_TILCDC_INIT) doesn't.
So I think it should be just obj-y, if obj-$(CONFIG_DRM_TILCDC) does not work.
Tomi