<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>1276</bug_id>
          
          <creation_ts>2011-07-22 14:12:02 +0000</creation_ts>
          <short_desc>[qemuppc] hello-mod fails to build</short_desc>
          <delta_ts>2011-08-17 08:08:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>ppc</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>bandaid available, investigating proper fix (16-Aug-2011)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Saul Wold">sgw</reporter>
          <assigned_to name="Darren Hart">dvhart</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>14935</commentid>
    <comment_count>0</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-07-22 14:12:02 +0000</bug_when>
    <thetext>ERROR: Function &apos;do_compile&apos; failed (see /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0/temp/log.do_compile.48446 for further information)
ERROR: Logfile of failure stored in: /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0/temp/log.do_compile.48446
Log data follows:
| ERROR: Function &apos;do_compile&apos; failed (see /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0/temp/log.do_compile.48446 for further information)
| NOTE: make -j 32 -e MAKEFLAGS= CC=ccache powerpc-poky-linux-gcc  LD=powerpc-poky-linux-ld --sysroot=/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc  AR=powerpc-poky-linux-ar  -C /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel scripts
| make: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[1]: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[1]: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[1]: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[2]: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[2]: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[2]: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[2]: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make[1]: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| NOTE: make -j 32 -e MAKEFLAGS= KERNEL_PATH=/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel KERNEL_SRC=/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel KERNEL_VERSION=3.0.0-rc7-yocto-standard+ CC=ccache powerpc-poky-linux-gcc  LD=powerpc-poky-linux-ld --sysroot=/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc  AR=powerpc-poky-linux-ar
| make -C /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel M=/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0
| make[1]: Entering directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
|   Building modules, stage 2.
|   MODPOST 1 modules
|   LD [M]  /vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0/hello.ko
| powerpc-poky-linux-ld: cannot find arch/powerpc/lib/crtsavres.o: No such file or directory
| make[2]: *** [/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/work/qemuppc-poky-linux/hello-mod-0.1-r0/hello.ko] Error 1
| make[1]: *** [modules] Error 2
| make[1]: Leaving directory `/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/build/tmp/sysroots/qemuppc/kernel&apos;
| make: *** [all] Error 2
| ERROR: oe_runmake failed
NOTE: package hello-mod-0.1-r0: task do_compile: Failed
NOTE: package task-core-qt-1.0-r3: task do_package: Started
ERROR: Task 6255 (/vol/1/sgw/autobuilder/poky-slave/poky-full-non/build/meta/recipes-kernel/hello-mod/hello-mod_0.1.bb, do_compile) failed with exit code &apos;1&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15488</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-08-16 10:58:38 +0000</bug_when>
    <thetext>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&apos;m looking into a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15498</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-08-16 20:48:09 +0000</bug_when>
    <thetext>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&apos;t deal with it well.

I&apos;ve sent details to the powerpc maintainers and Makefile contributors to try and come up with an informed solution (I don&apos;t know why it&apos;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 &quot;*.[csS]&quot; -exec rm &apos;{}&apos; \;
        find $kerneldir/Documentation -name &quot;*.txt&quot; -exec rm &apos;{}&apos; \;
 
+       # 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} = &quot;powerpc&quot; ]; 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=&quot;arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15513</commentid>
    <comment_count>3</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-08-17 08:08:56 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=978cdd5cb5b445f1cf406296444cb57cd8aa526a</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>