| Summary: | [qemuppc] hello-mod fails to build | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Saul Wold <sgw> |
| Component: | core | Assignee: | Darren Hart <dvhart> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | meta.mr.watcher, meta.watcher |
| Version: | 1.0 | ||
| Target Milestone: | 1.1 | ||
| Hardware: | Other | ||
| OS: | ppc | ||
| Whiteboard: | bandaid available, investigating proper fix (16-Aug-2011) | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Saul Wold
2011-07-22 14:12:02 UTC
This appears to be a bug in the Linux kernel build system. Removing the clean command from the kernel.bbclass allows hello-mod to build successfully. As the clean target is intended to clean everything except what is necessary to build external modules, it appears to be broken per spec. I'm looking into a fix. There has been several issues regarding arch/powerpc/lib/crtsavres.o. It is the only .o required for module building in the kernel so far as I can tell, and the make system doesn't deal with it well.
I've sent details to the powerpc maintainers and Makefile contributors to try and come up with an informed solution (I don't know why it's listed in KBUILD_LDFLAGS_MODULE as it seems to build fine with that commented out).
If I am unsuccessful there, the following can serve as a fix until a proper upstream fix becomes available:
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7dc9cc6..92c0736 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -159,6 +159,13 @@ kernel_do_install() {
find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
+ # FIXME: remove this block once a fix is available in mainline.
+ # The clean target removes crtsavres.o which is present in
+ # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+ if [ ${ARCH} = "powerpc" ]; then
+ cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+ fi
+
# Remove the following binaries which cause strip errors
# during do_package for cross-compiled platforms
bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
|