]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: provide module.lds for out of tree builds in v5.10+
authorBruce Ashfield <bruce.ashfield@gmail.com>
Fri, 13 Nov 2020 06:32:06 +0000 (01:32 -0500)
committerSteve Sakoman <steve@sakoman.com>
Mon, 30 Nov 2020 14:58:17 +0000 (04:58 -1000)
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 <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>
(cherry picked from commit 0fc66a0b64953aae38d0124b57615fffaec8de52)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/kernel.bbclass
meta/recipes-kernel/linux/kernel-devsrc.bb

index 9e3c34ad481bf8d39b95f8073f35e9bf31722dbe..58c9f171dcc658c5ecb644d8e8e14dadfba4beb0 100644 (file)
@@ -465,6 +465,7 @@ do_shared_workdir () {
        # Copy files required for module builds
        cp System.map $kerneldir/System.map-${KERNEL_VERSION}
        [ -e Module.symvers ] && cp Module.symvers $kerneldir/
+       [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
        cp .config $kerneldir/
        mkdir -p $kerneldir/include/config
        cp include/config/kernel.release $kerneldir/include/config/kernel.release
index 5940cc90eaa311493b3691ca58e9bf4aaf5f2f4e..951e7635cc6b310b6a7ff4d984da9bca36cb36f7 100644 (file)
@@ -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