diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-11-13 01:32:06 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-16 14:27:46 +0000 |
commit | 92eceb5f1daf30c7320259ed2e494cc2a69acfb4 (patch) | |
tree | da4e275a3858d3c171c86cc17b210ff001fde346 | |
parent | aaf6aa3e530deb4a8d818a55a37b9029980b0b0d (diff) | |
download | poky-92eceb5f1daf30c7320259ed2e494cc2a69acfb4.tar.gz |
kernel: provide module.lds for out of tree builds in v5.10+
The upstream commit 596b0474d3d [kbuild: preprocess module linker
script], adds a dependency on module.lds for external module
building.
Since module.lds is generated as part of 'modules_prepare', we
must make it available with the other kernel artifacts in the
kernel shared workdir, otherwise out of tree builds fail.
This fixes errors like:
| make[4]: *** No rule to make target 'scripts/module.lds', needed by
'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
Stop.
| make[4]: *** Waiting for unfinished jobs....
We also ensure that kernel-devsrc has a copy to support on
target module builds that are often prepared with 'make scripts
prepare'. Those targets won't regenerate it, so the build fails.
If 'make modules_prepare' is used, the file will be regenerated
and overwrite our copy (as expected).
(From OE-Core rev: 0fc66a0b64953aae38d0124b57615fffaec8de52)
Signed-off-by: Pan, Kris <kris.pan@intel.com>
Signed-off-by: Lili Li <lili.li@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/kernel.bbclass | 1 | ||||
-rw-r--r-- | meta/recipes-kernel/linux/kernel-devsrc.bb | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 78def5bbc1..22c92381c0 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -486,6 +486,7 @@ do_shared_workdir () { | |||
486 | # Copy files required for module builds | 486 | # Copy files required for module builds |
487 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} | 487 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} |
488 | [ -e Module.symvers ] && cp Module.symvers $kerneldir/ | 488 | [ -e Module.symvers ] && cp Module.symvers $kerneldir/ |
489 | [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds | ||
489 | cp .config $kerneldir/ | 490 | cp .config $kerneldir/ |
490 | mkdir -p $kerneldir/include/config | 491 | mkdir -p $kerneldir/include/config |
491 | cp include/config/kernel.release $kerneldir/include/config/kernel.release | 492 | cp include/config/kernel.release $kerneldir/include/config/kernel.release |
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index aa8e162f4f..8373c97a31 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb | |||
@@ -86,6 +86,12 @@ do_install() { | |||
86 | # be dealt with. | 86 | # be dealt with. |
87 | # cp -a scripts $kerneldir/build | 87 | # cp -a scripts $kerneldir/build |
88 | 88 | ||
89 | # although module.lds can be regenerated on target via 'make modules_prepare' | ||
90 | # there are several places where 'makes scripts prepare' is done, and that won't | ||
91 | # regenerate the file. So we copy it onto the target as a migration to using | ||
92 | # modules_prepare | ||
93 | cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || : | ||
94 | |||
89 | if [ -d arch/${ARCH}/scripts ]; then | 95 | if [ -d arch/${ARCH}/scripts ]; then |
90 | cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH} | 96 | cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH} |
91 | fi | 97 | fi |