When you build a kernel module out of tree (e.g. as with the hello-mod example) the build system uses the linux-libc-headers instead of the headers of your preferred kernel. If you're depending on the changes then this is a significant problem... In my case I can show the search path to be : bitbake linux-imx -c devshell ... devshell ... `arm-oe-linux-gnueabi-gcc -print-prog-name=cc1` -v ignoring nonexistent directory "/workdrive/projects/vibe/src/fsl-community-bsp/build/tmp-eglibc/sysroots/pevmachine/usr/local/include" ignoring nonexistent directory "/workdrive/projects/vibe/src/fsl-community-bsp/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/cortexa9hf-vfp-neon-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/../../../../../arm-oe-linux-gnueabi/include" #include "..." search starts here: #include <...> search starts here: /workdrive/projects/vibe/src/fsl-community-bsp/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/cortexa9hf-vfp-neon-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/include /workdrive/projects/vibe/src/fsl-community-bsp/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/cortexa9hf-vfp-neon-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.1/include-fixed /workdrive/projects/vibe/src/fsl-community-bsp/build/tmp-eglibc/sysroots/pevmachine/usr/include End of search list. So this means it picks up the includes from sysrootfs i.e. the linux-libc-headers.
Bruce, I'm going to toss this one over to you - at least for your initial thoughts.
When you actually build the module, it will use the kernel build system, which sets its own include paths and hence will find the sysroot/kernel source headers first. Do you have a specific build problem, or another test that shows this without devshell ?
The hello-mod recipe uses module.bbclass and does not use linux-libc-headers. If you do things from the devshell, you will hit issues like this. I you have a proper recipe which doesn't work and more info, please reopen, otherwise I can't see the issue here.