From 0fc66a0b64953aae38d0124b57615fffaec8de52 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Fri, 13 Nov 2020 01:32:06 -0500 Subject: 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). Signed-off-by: Pan, Kris Signed-off-by: Lili Li Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie --- meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'meta/recipes-kernel/linux/kernel-devsrc.bb') 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() { # be dealt with. # cp -a scripts $kerneldir/build + # although module.lds can be regenerated on target via 'make modules_prepare' + # there are several places where 'makes scripts prepare' is done, and that won't + # regenerate the file. So we copy it onto the target as a migration to using + # modules_prepare + cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || : + if [ -d arch/${ARCH}/scripts ]; then cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH} fi -- cgit 1.2.3-korg