<?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>605</bug_id>
          
          <creation_ts>2010-12-20 10:38:11 +0000</creation_ts>
          <short_desc>GCC-cross uses incorrect paths making sstate copy unusable</short_desc>
          <delta_ts>2011-01-18 06:04:01 +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>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gary Thomas">gary</reporter>
          <assigned_to name="Kevin Tian">kevin.tian</assigned_to>
          <cc>kevin.tian</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</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>11247</commentid>
    <comment_count>0</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2010-12-20 10:38:11 +0000</bug_when>
    <thetext>I just tried this experiment:
  * Build Poky on MachineA to some directory $NEW
  * Copy Poky ($POKYBASE) and $NEW/sstate-cache to MachineB, in this case
    the path for $POKYBASE is the same on both machines but $NEW differs.
    MachineA:$NEW does not exist on MachineB
  * Try to build on Machine B, pointing SSTATE_MIRRORS to $NEW/sstate-cache
    This build is in $NEW2
The process fails for me building the kernel:
  | arm-poky-linux-gnueabi-ld: libgcc.a: No such file: No such file or directory
Looking carefully, I can see that the compiler is looking for libgcc.a in
the directory path $NEW that is only on MachineA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11248</commentid>
    <comment_count>1</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2010-12-20 10:39:37 +0000</bug_when>
    <thetext>My test was based on commit bb783afd4daa3f57fb26e2bb86f5bc9cbeb11df0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11258</commentid>
    <comment_count>2</comment_count>
    <who name="Kevin Tian">kevin.tian</who>
    <bug_when>2010-12-21 03:55:08 +0000</bug_when>
    <thetext>I only have one machine, and thus tried a different step:

* build Poky in $DIR1, with sstate generated in ${SSTATE-CACHE} (a global one)
* then with same $POKYBASE, create a new build $DIR2, with SSTATE_MIRRORS
pointing to ${SSTATE-CACHE}
* move $DIR1 to $DIR1.bak

I think this way it&apos;s identical to what Gary did with two machines, but I didn&apos;t see such failures.

so Gary, could you try latest poky master or verify whether my single-machine steps may expose same failure in your side? Or is there any step not equivalent between our cases?

Mine commit is based on:


commit 60ccdaa0ea128ac19113c0746c6e12bd02b2fc12
Author: Mark Hatle &lt;mark.hatle@windriver.com&gt;
Date:   Wed Nov 24 18:06:04 2010 -0600

    poky-init-build-env: Enable all POSIX shells

    Update the script so that it will work in more then just bash.  If bash
    is not used, it will assume the PWD is the Poky location.  (This is because
    BASH_SOURCE is a bash-ism, and equivalent functionality is not available in
    other shells).

    This has been verified with dash (see comment in the code), ksh, zsh and
    of course bash.

    Signed-off-by: Mark Hatle &lt;mark.hatle@windriver.com&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11304</commentid>
    <comment_count>3</comment_count>
      <attachid>82</attachid>
    <who name="Gary Thomas">gary</who>
    <bug_when>2010-12-23 04:25:26 +0000</bug_when>
    <thetext>Created attachment 82
Add --sysroot to ${KERNEL_CC} to fix path problems</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11305</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2010-12-23 05:47:09 +0000</bug_when>
    <thetext>Gary, could you paste a little more context around the error please? Is this whilst building something in kernel space or userspace (like tracing tools)? The kernel itself shouldn&apos;t need libgcc...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11323</commentid>
    <comment_count>5</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2010-12-27 10:59:03 +0000</bug_when>
    <thetext>I have my own kernel recipe which is very simple and based
on 2.6.32.

I&apos;ve reproduced this error on a single machine like this:
  * Build Poky in /local/poky_base
  * Rename /local/poky_base to /local/poky_base_moved
  * Build Poky in /local/poky_rebuild, pointing SSTATE_MIRRORS
    to /local/poky_base_moved/sstate-cache
  * Bump PR on my kernel recipe (manually)
  * Rebuild - fails linking the kernel

What I found is I get this error:
  arm-poky-linux-gnueabi-ld --sysroot=/local/poky_rebuild/tmp/sysroots/armv7a-poky-linux-gnueabi     --defsym zreladdr=0x80008000 --defsym initrd_phys=0x80800000 --defsym params_phys=0x80000100 -p --no-undefined -X libgcc.a -T arch/arm/boot/compressed/vmlinux.lds arch/arm/boot/compressed/head.o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/misc.o -o arch/arm/boot/compressed/vmlinux 
  arm-poky-linux-gnueabi-ld: libgcc.a: No such file: No such file or directory

This is derived from the bootstrap Makefile.  Using grep in the arch/arm/boot
tree, I found this:
  tmp/work/cobra3530p60-poky-linux-gnueabi/linux-am-2.6.32-1/linux-am-2.6.32/arch/arm/boot/compressed/Makefile:  $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T

The problem with this is that $(CC) in the kernel build
corresponds to ${KERNEL_CC} from meta/classes/kernel.bbclass
Without the --sysroot= in that variable, it will try and find
libgcc.a in the tree where GCC was built (/local/poky_base)
but it&apos;s no longer there.

It&apos;s pretty obvious that at least for this kernel, the 
dependency on libgcc.a is explicit.  Adding the --sysroot=
option to ${KERNEL_CC} seems like a useful way to fix
the build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11514</commentid>
    <comment_count>6</comment_count>
    <who name="Kevin Tian">kevin.tian</who>
    <bug_when>2011-01-18 06:04:01 +0000</bug_when>
    <thetext>fixed by 14762f71b9f839432ede0406b9443ce20b918378</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82</attachid>
            <date>2010-12-23 04:25:26 +0000</date>
            <delta_ts>2010-12-23 04:25:26 +0000</delta_ts>
            <desc>Add --sysroot to ${KERNEL_CC} to fix path problems</desc>
            <filename>0001-Include-sysroot-in-KERNEL_CC-allows-tools-to-move.patch</filename>
            <type>text/plain</type>
            <size>1049</size>
            <attacher name="Gary Thomas">gary</attacher>
            
              <data encoding="base64">RnJvbSAzMTZjNWYzNDcxMDZmNGVkYjNkNzI4MTgwMjU5MTZjYWMxNjRkNTI2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBHYXJ5IFRob21hcyA8Z2FyeUBtbGJhc3NvYy5jb20+CkRhdGU6
IFRodSwgMjMgRGVjIDIwMTAgMDU6MjA6MjAgLTA3MDAKU3ViamVjdDogW1BBVENIXSBJbmNsdWRl
IC0tc3lzcm9vdCBpbiAke0tFUk5FTF9DQ30gLSBhbGxvd3MgdG9vbHMgdG8gbW92ZQoKU2lnbmVk
LW9mZi1ieTogR2FyeSBUaG9tYXMgPGdhcnlAbWxiYXNzb2MuY29tPgotLS0KIG1ldGEvY2xhc3Nl
cy9rZXJuZWwuYmJjbGFzcyB8ICAgIDMgKystCiAxIGZpbGVzIGNoYW5nZWQsIDIgaW5zZXJ0aW9u
cygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9tZXR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