module-base: use modules_prepare build target in do_make_scripts()
PATCH 1/1 module-base: use modules_prepare build target in do_make_scripts()
The kernel Makefile's 'modules_prepare' target must be called for fully setting up a module build environment. Unlike calling 'scripts' target, this also calls 'prepare' target which compiles 'objtool' for example.
Otherwise, when having CONFIG_STACK_VALIDATION in kernel config enabled, module build will fail with
| make[5]: *** No rule to make target 'tools/objtool/objtool', needed by '[...]'
The 'modules_prepare' target also requires bc-native to be present in sysroot.
Signed-off-by Enrico Jorns <[email protected]>
--- meta/classes/module-base.bbclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
meta/classes/module-base.bbclass +6 -3
@@ -18,10 +18,13 @@ KERNEL_OBJECT_SUFFIX = ".ko" # kernel modules are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" -# Function to ensure the kernel scripts are created. Expected to -# be called before do_compile. See module.bbclass for an example. +DEPENDS += "bc-native" + +# Function to ensure the kernel scripts and utilities required for building +# modules are created. +# Expected to be called before do_compile. See module.bbclass for an example. 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} modules_prepare }
Signature · 1 line
2.15.1