On Tue, Jul 10, 2018 at 12:11 AM, Michael Allwright
<michael.allwri...@ulb.ac.be> wrote:
> Am I correct in expecting that, if I do everything correctly, my header file
> from module-a should end up in
> ~/poky/build/tmp/work-shared/machine/kernel-source/include/linux/mfd

No, the kernel-source directory is for the kernel recipe and other
recipes can't generally add anything too it (if you want a header to
show up in the kernel source directory then you could patch the kernel
sources though).

Other (ie non-kernel) recipes share headers etc via sysroot, which
with OE 2.3 and above is created for each recipe in the
"recipe-sysroot" subdirectory in the recipe's WORKDIR.

>From what you've said so far, I guess module-a's header file is in
module-b's sysroot directory under /usr/include, but when module-b is
compiled the include path isn't setup to find it.

Since /usr/include in sysroot contains headers for user space it's
quite correct that it shouldn't be in the include path when building a
kernel module (e.g. to prevent accidentally including user space
string.h instead of the kernel version, etc, etc). When the kbuild
Makefiles call the compiler they will not pass a --sysroot option etc.

If module-a is sharing a header in a subdirectory of sysroot, you will
need to somehow manually add that directory as an extra include path
when module-b is compiled (don't try to add the whole of sysroot
/usr/include - just the specific subdirectory you need).

A possible alternative approach might be to create one recipe which
builds all your kernel modules. That would make the build self more
contained as each module can find headers from other modules somewhere
in ${S}.
-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to