* [PATCH] module-base: use modules_prepare build target in do_make_scripts()
@ 2018-01-31 11:48 Enrico Jorns
0 siblings, 0 replies; only message in thread
From: Enrico Jorns @ 2018-01-31 11:48 UTC (permalink / raw)
To: openembedded-core; +Cc: Enrico Jorns
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 <ejo@pengutronix.de>
---
meta/classes/module-base.bbclass | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass
index 6fe77c01b7..bee6cac916 100644
--- a/meta/classes/module-base.bbclass
+++ b/meta/classes/module-base.bbclass
@@ -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
}
--
2.15.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-31 11:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 11:48 [PATCH] module-base: use modules_prepare build target in do_make_scripts() Enrico Jorns
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.