]> code.ossystems Code Review - openembedded-core.git/commitdiff
make-mod-scripts/kernel-devsrc: Fix objtool issues
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 28 Jul 2018 08:49:49 +0000 (16:49 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Aug 2018 09:22:26 +0000 (10:22 +0100)
Kernels which use tools/objtool can now fail when building external modules
due to objtool being missing, the generated files can also cause problems
for kernel-devsrc.

Ensure objtool is generated in make-mod-scripts by also calling
"make prepare".

For devsrc, delete the generated binaries since they'd be native
binaries and unsuitable for the target.

The oeqa kernel module tests also need to have the additional "make prepare"
step added.

(From OE-Core rev: 52fd2993784b4218f5df4f343e7da45d964df305)

Fixes [YOCTO #12860]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Tweaked to add "make prepare" to module-base.bbclass instead of
make-mod-scripts.bb]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/module-base.bbclass
meta/lib/oeqa/runtime/cases/kernelmodule.py
meta/recipes-kernel/linux/kernel-devsrc.bb

index 6fe77c01b7edbeba10664e7a16612a63a6361474..64729770c7f99d05232a666decf9d38677310317 100644 (file)
@@ -23,5 +23,5 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 do_make_scripts() {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 
        make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
-                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts
+                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare
 }
index 11ad7b7f01b519ddee7875296f9549bdb3a5b64b..de1a5aa4457ea24125d618c801a7725bcfd3936e 100644 (file)
@@ -28,7 +28,7 @@ class KernelModuleTest(OERuntimeTestCase):
     @OETestDepends(['gcc.GccCompileTest.test_gcc_compile'])
     def test_kernel_module(self):
         cmds = [
-            'cd /usr/src/kernel && make scripts',
+            'cd /usr/src/kernel && make scripts prepare',
             'cd /tmp && make',
             'cd /tmp && insmod hellomod.ko',
             'lsmod | grep hellomod',
index c1b5b7786d7c25306e6b1dcd0b1f16962a95a665..8bbfa23e4b86296b98eee73ba89e6b42fff4226a 100644 (file)
@@ -69,6 +69,13 @@ do_install() {
                 cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
         fi
 
+        # Remove fixdep/objtool as they won't be target binaries
+        for i in fixdep objtool; do
+                if [ -e $kerneldir/tools/objtool/$i ]; then
+                        rm -rf $kerneldir/tools/objtool/$i
+                fi
+        done
+
         chown -R root:root ${D}
 }
 # Ensure we don't race against "make scripts" during cpio