[OE-core] Problem with module.bbclass

Anders Darander anders at chargestorm.se
Fri May 22 05:32:19 UTC 2015


* Steffen.Pankratz at elektrobit.com <Steffen.Pankratz at elektrobit.com> [150521 16:14]:

> > -----Original Message-----
> > From: Paul Eggleton [mailto:paul.eggleton at linux.intel.com]
> > Sent: Thursday, May 21, 2015 3:54 PM
> > To: Pankratz, Steffen
> > Cc: openembedded-core at lists.openembedded.org
> > Subject: Re: [OE-core] Problem with module.bbclass

>  HiPaul,

> > > I am using
> > > http://git.openembedded.org/openembedded-
> > core/tree/meta/classes/module
> > > .bbcl ass as a base for my recipe to compile a kernel module outside
> > > of the kernel tree.

> > > This is my recipe:

> > > DESCRIPTION = "Nouveau kernel module"
> > > SECTION = "kernel/modules"
> > > LICENSE = "CLOSED" #fixme
> > > PR = "r0"
> > > SRC_URI =
> > "git://github.com/Gnurou/nouveau;protocol=https;branch=staging"
> > > SRCREV = "c256f9450c613cd5075fc8c4a407686925041487"
> > > S = "${WORKDIR}/git/drm/nouveau"
> > > inherit module

> > > Naively, I hoped that would work out of the box. Of course it did not
> > > :) and
> > every compiler call resulted in an error message like this:
> > > | make: *** [lib/nvif/notify.o] Error 1 In file included from
> > > | ./lib/include/nvif/os.h:32:0,

> > > |                  from ./drm/nouveau/include/nvif/object.h:4,
> > > |                  from ./drm/nouveau/include/nvif/device.h:4,

> > > |                  from drm/nouveau/nvif/device.c:25:
> > > | /home/vagrant/repos/tk1/build/tmp/sysroots/x86_64-
> > linux/usr/lib/arm-
> > > | poky-l
> > > | inux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/include/stdint.h:9:26:
> > > | fatal
> > > | error: stdint.h: No such file or directory|  # include_next
> > > | <stdint.h>

> > > |                           ^

> > > | compilation terminated.

> > > I could resolve that issue by adding the following line to my recipe:

> > > EXTRA_OEMAKE='-C "${STAGING_KERNEL_DIR}"'

> > > And another problem I had faced was that using:

> > > S = "${WORKDIR}/git/drm/nouveau"

> > > Compiled all kernel modules inside the kernel tree, instead only the
> > > nouveau kernel module.

> > > I could solve that as well and finally I ended up with:

> > > EXTRA_OEMAKE='-C "${STAGING_KERNEL_DIR}" M="${S}"/drm/nouveau/'

> > > Now, I am not sure if I am doing something wrong or if there maybe is
> > > a problem with module.bbclass.

> > The original message makes it sound like the makefile for the module isn't
> > using CC but instead calling gcc directly, and thus not getting the --sysroot
> > option passed in - is that possible?

> Not sure, but for me the makefile looks good.
> Here is the code of the nouveau kernel module I am using in my recipe:

> https://github.com/Gnurou/nouveau

Well, after only a quick glance at that repo, it seems that the toplevel
Makefile isn't concerned with building a kernel module. Instead it
builds binaries and libraries (user-space). Thus, module.bbclass isn't
really suited for that part.

OTOH, the kernel module is in the drm directory. However, that Makefile
uses LINUX_DIR to find the kernel's Makefile, and LINUX_DIR isn't
exported by module.bbclass. To build this module, you should ensure that
you cd into the directory, and you also need to set (at least)
EXTRA_OEMAKE += "LINUX_DIR=${STAGING_KERNEL_DIR}"

Cheers,
Anders


-- 
Anders Darander
ChargeStorm AB / eStorm AB



More information about the Openembedded-core mailing list