Bug 12860

Summary: meta-intel[rocko]: out of tree kernel module builds fail for linux-intel 4.14 after update to 4.14.27
Product: [Build System, Metadata & Runtime] BSPs Reporter: Henry Bruce <henry.bruce>
Component: bsps-meta-intelAssignee: Anuj Mittal <anuj.mittal>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium+ CC: bruce.ashfield, denis, randy.macleod, richard.purdie
Version: 2.4.3   
Target Milestone: 2.4.4   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: Don't know

Description Henry Bruce 2018-07-20 06:36:14 UTC
After the update to kernel 4.14.27, out of tree module builds started failing.
I'm using poky's meta-skeleton hello-mod recipe as an example.

Steps to re-create
------------------
These steps use meta-intel rt kernel 4.14.40 
$ git clone -b rocko git://git.yoctoproject.org/poky
$ git clone -b rocko git://git.yoctoproject.org/metal-intel
$ source poky/oe-init-build-env
$ bitbake-layers add-layer ../poky/meta-skeleton/
$ bitbake-layers add-layer ../meta-intel/
$ cat <<EOF >> conf/local.conf
MACHINE = "intel-corei7-64"
PREFERRED_PROVIDER_virtual/kernel = "linux-intel-rt"
PREFERRED_VERSION_linux-intel-rt = "4.14%"
EOF
$ bitbake hello-mod
...
| make -C /path/to/build/tmp/work-shared/intel-corei7-64/kernel-source M=/media/md126p1/yocto/hbruce/rocko/kmod-bug/build/tmp/work/intel_corei7_64-poky-linux/hello-mod/0.1-r0
| make[1]: Entering directory '/path/to/build/tmp/work-shared/intel-corei7-64/kernel-source'
| make[2]: Entering directory '/path/to/build/tmp/work-shared/intel-corei7-64/kernel-build-artifacts'
| make[3]: *** No rule to make target 'tools/objtool/objtool', needed by '/path/to/build/tmp/work/intel_corei7_64-poky-linux/hello-mod/0.1-r0/hello.o'.  Stop.
...
Summary: 1 task failed:
  /path/to/poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

Workaround
----------
Follow above steps but revert to kernel 4.14.24
$ cd ../meta-intel
$ git checkout 91ad013e655d56889efe9b65c1c7691dea5034c4
HEAD is now at 91ad013... linux-intel-rt_4.14: update to v4.14.24
$ cd ../build
$ bitbake hello-mod
NOTE: Tasks Summary: Attempted 527 tasks of which 493 didn't need to be rerun and all succeeded.
Comment 1 Henry Bruce 2018-07-20 20:55:24 UTC
Some more details
1. Build fails in the same way with linux-intel kernel (i.e. bug is not specific to rt config)
2. Build succeeds with linux-intel-4.9.81 so bug is specific to 4.14
3. california.l.sullivan@intel.com thought bug might be fixed by https://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/commit/?h=yocto-4.14&id=b6b5ac8d6d4854a2fc8394c40879bffbafc08578, but this patch is already applied
4. backport-iwlwifi also fails to build
| make[8]: *** No rule to make target '/path/to/build/tmp/work/corei7-64-intel-common-poky-linux/backport-iwlwifi/30-r0/git/net/mac80211/main.o', needed by '/path/to/build/tmp/work/corei7-64-intel-common-poky-linux/backport-iwlwifi/30-r0/git/net/mac80211/mac80211.o'.  Stop.
Comment 2 Henry Bruce 2018-07-24 21:43:11 UTC
I am building on Fedora 26. Package elfutils-libelf-devel-0.170-4.fc26.x86_64 is installed.

Build is successful on sumo, so this is a rocko specific bug.
Comment 3 Anuj Mittal 2018-07-25 05:23:00 UTC
OE-core rocko has the highest kernel version of 4.12 so that is probably why this issue isn't seen on YP autobuilder. 

This would need these commits backported to be able to support 4.14+ kernels with OE-core rocko:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=0f85563eacf5138d98b826343cdfc3833d1c5c8e

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=dfb9ffbafddd76e30e891c5d597b7c547d6f3aa5

These should not have any impact as mentioned by Bruce on the compilation of older kernels present in OE-core and will also ensure that we support layers that build their own custom kernel based on 4.14 and newer.
Comment 4 Henry Bruce 2018-07-30 16:30:16 UTC
Looking forward to seeing these fixes backport to rocko. Please update bug when this happens. Do you have a schedule estimate?
Comment 5 Anuj Mittal 2018-07-30 23:05:37 UTC
Armin has pulled this in his branch so it should get merged soon. If you'd like to test, it's here:

https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/rocko-nmut
Comment 7 Denys Dmytriyenko 2018-08-16 00:43:31 UTC
Great, now it breaks out-of-tree modules for other BSPs... :(
http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154189.html
Comment 9 Anuj Mittal 2018-08-30 01:09:41 UTC
(In reply to comment #8)
> The fix got merged in:
> http://cgit.openembedded.org/openembedded-core/commit/
> ?h=rocko&id=eb3eaa6970bb8c3647187593df23e2784dd26935

Closing this now, thanks!