linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH RFC 5/6] drm/tilcdc: Force building of DRM_TILCDC_INIT
       [not found] ` <2f0e612a87ad97ff9a0b512456a2fe0880d99d54.1424961754.git.jsarha@ti.com>
@ 2015-03-02 12:59   ` Tomi Valkeinen
  0 siblings, 0 replies; only message in thread
From: Tomi Valkeinen @ 2015-03-02 12:59 UTC (permalink / raw)
  To: Jyri Sarha, linux-kbuild, Michal Marek
  Cc: dri-devel, airlied, linux-omap, devicetree, bcousson, tony,
	detheridge, moinejf, linux

[-- Attachment #1: Type: text/plain, Size: 2277 bytes --]

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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-02 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1424961754.git.jsarha@ti.com>
     [not found] ` <2f0e612a87ad97ff9a0b512456a2fe0880d99d54.1424961754.git.jsarha@ti.com>
2015-03-02 12:59   ` [PATCH RFC 5/6] drm/tilcdc: Force building of DRM_TILCDC_INIT Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).