<?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>1021</bug_id>
          
          <creation_ts>2011-05-03 06:11:42 +0000</creation_ts>
          <short_desc>libgcc doesn&apos;t install crt*.o into target sato-sdk image</short_desc>
          <delta_ts>2011-05-24 19:27:48 +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>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dexuan Cui">dexuan.cui</reporter>
          <assigned_to name="Nitin Kamble">nitin.a.kamble</assigned_to>
          <cc>liang.li2</cc>
    
    <cc>liangliang.wang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</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>13539</commentid>
    <comment_count>0</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-05-03 06:11:42 +0000</bug_when>
    <thetext>Using recent poky master, I got a ld error &quot;can&apos;t find crtbegin.o&quot; when I build a simple c program in sato-sdk target.

I checked a recent image:
wget http://autobuilder.yoctoproject.org/nightly/20110429-1/machines/qemu/qemu86/core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2

tar -jtf core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2
 | grep crtbegin.o returns nothing.


But 
wget http://autobuilder.yoctoproject.org/nightly/20110402-1/machines/qemu/qemu86/poky-image-sato-sdk-qemux86-20110403065104.rootfs.tar.bz2

tar -jtf core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2
 | grep crtbegin.o
returns
./usr/lib/i586-poky-linux/4.5.1/crtbegin.o.

So looks this bug crept into poky master after Apr 2 somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13558</commentid>
    <comment_count>1</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-05-03 20:48:46 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Using recent poky master, I got a ld error &quot;can&apos;t find crtbegin.o&quot; when I build
&gt; a simple c program in sato-sdk target.
&gt; I checked a recent image:
&gt; wget
&gt; http://autobuilder.yoctoproject.org/nightly/20110429-1/machines/qemu/qemu86/core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2
&gt; tar -jtf core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2
&gt;  | grep crtbegin.o returns nothing.
&gt; But 
&gt; wget
&gt; http://autobuilder.yoctoproject.org/nightly/20110402-1/machines/qemu/qemu86/poky-image-sato-sdk-qemux86-20110403065104.rootfs.tar.bz2
&gt; tar -jtf core-image-sato-sdk-qemux86-20110428214821.rootfs.tar.bz2
Sorry for the typo -- I meant &quot;tar -jtf poky-image-sato-sdk-qemux86-20110403065104.rootfs.tar.bz2...&quot; here.

&gt;  | grep crtbegin.o
&gt; returns
&gt; ./usr/lib/i586-poky-linux/4.5.1/crtbegin.o.
&gt; So looks this bug crept into poky master after Apr 2 somehow.

The recent good one seems:
 http://autobuilder.yoctoproject.org/nightly/20110423-1/machines/qemu/qemumips/core-image-sato-sdk-qemumips-20110423220931.rootfs.tar.bz2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13639</commentid>
    <comment_count>2</comment_count>
    <who name="Liang Wang">liangliang.wang</who>
    <bug_when>2011-05-09 01:57:00 +0000</bug_when>
    <thetext>This issue also occurs on the latest nightly build 20110506-4 for qemuarm-sato-sdk, mpc8315e-sato-sdk and routerstationpro-sato-sdk.

build http://autobuilder.yoctoproject.org/nightly/20110506-4
git commit 856a5e496b7ddd814f6a94552d02074f0ab30842


tar jtf core-image-sato-sdk-routerstationpro-20110507194330.rootfs.tar.bz2 | grep crtbegin.o  returns nothing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13641</commentid>
    <comment_count>3</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2011-05-09 03:27:33 +0000</bug_when>
    <thetext>the error also happend on mpc8315e-rdb sato-sdk images from nightly build 20110506-4:
http://autobuilder.pokylinux.org/nightly/20110506-4/machines/mpc8315e-rdb/ppc/

When use gcc and g++ to compile c program ,the errors below:
root@mpc8315e-rdb:~# g++ test.c -o test -lm
/usr/lib/gcc/powerpc-poky-linux/4.5.1/../../../../powerpc-poky-linux/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/lib/gcc/powerpc-poky-linux/4.5.1/../../../../powerpc-poky-linux/bin/ld: cannot find libgcc.a
collect2: ld returned 1 exit status
use command &quot;gcc test.c -o test -lm&quot; ,got the similiar result.
 
Compare the rootfs of 20110412-1 and 20110506-4:
crtbegin.o and libgcc.a exist in &quot;/usr/lib/powerpc-poky-linux/4.5.1&quot; dir of 20110412-1 rootfs, but all not exist in 20110506-4 rootfs,and &quot;/usr/lib/powerpc-poky-linux&quot; dir doesn&apos;t exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13643</commentid>
    <comment_count>4</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-05-09 08:42:54 +0000</bug_when>
    <thetext>so the issue came up in the 20110423 - 20110506 time frame, right ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13651</commentid>
    <comment_count>5</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2011-05-09 18:33:40 +0000</bug_when>
    <thetext>the both file crtbegin.o and libgcc.a exists in mpc8315e-rdb rootfs images from nightly build 20110423-1:
http://autobuilder.pokylinux.org/nightly/20110423-1/machines/mpc8315e-rdb/ppc/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13653</commentid>
    <comment_count>6</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2011-05-09 21:06:55 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; the error also happend on mpc8315e-rdb sato-sdk images from nightly build
&gt; 20110506-4:
&gt; http://autobuilder.pokylinux.org/nightly/20110506-4/machines/mpc8315e-rdb/ppc/
&gt; 
&gt; When use gcc and g++ to compile c program ,the errors below:
&gt; root@mpc8315e-rdb:~# g++ test.c -o test -lm
&gt; /usr/lib/gcc/powerpc-poky-linux/4.5.1/../../../../powerpc-poky-linux/bin/ld:
&gt; cannot find crtbegin.o: No such file or directory
&gt; /usr/lib/gcc/powerpc-poky-linux/4.5.1/../../../../powerpc-poky-linux/bin/ld:
&gt; cannot find libgcc.a
&gt; collect2: ld returned 1 exit status
&gt; use command &quot;gcc test.c -o test -lm&quot; ,got the similiar result.
&gt; 
&gt; Compare the rootfs of 20110412-1 and 20110506-4:
&gt; crtbegin.o and libgcc.a exist in &quot;/usr/lib/powerpc-poky-linux/4.5.1&quot; dir of
&gt; 20110412-1 rootfs, but all not exist in 20110506-4 rootfs,and
&gt; &quot;/usr/lib/powerpc-poky-linux&quot; dir doesn&apos;t exist.

the similiar error also happened when compile a C program using gcc and g++  from toolchain image from nightly build 20110506-4:
http://autobuilder.pokylinux.org/nightly/20110506-4/toolchain/x86_64/poky-eglibc-x86_64-powerpc-toolchain-gmae-1.0+snapshot-20110508.tar.bz2
errors below:
1. source /opt/poky/1.0+snapshot/environment-setup-ppc603e-poky-linux
2. ${CC} test.c -o testc -lm -static
/opt/poky/1.0+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/ppc603e-poky-linux/gcc/powerpc-poky-linux/4.6.0/ld: cannot find crtbeginT.o: No such file or directory
/opt/poky/1.0+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/ppc603e-poky-linux/gcc/powerpc-poky-linux/4.6.0/ld: cannot find -lgcc
/opt/poky/1.0+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/ppc603e-poky-linux/gcc/powerpc-poky-linux/4.6.0/ld: cannot find -lgcc_eh
collect2: ld returned 1 exit status
3. the same error when run &quot;${CXX} test.cpp -o testcpp -lm -static&quot;. 

test env: 
ubuntu 10.10 x86_64 
kernel : 2.6.35-28-generic</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13661</commentid>
    <comment_count>7</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-05-10 18:31:27 +0000</bug_when>
    <thetext>The crt*.o files are installed by libgcc-dev rpm. Is that installed in the failing case ? if yes what files are installed by the libgcc-dev?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13664</commentid>
    <comment_count>8</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2011-05-10 18:48:13 +0000</bug_when>
    <thetext>On mpc8315e-rdb, only libgcc-s-dev-4.6.0-r0.ppc603e was found :
root@mpc8315e-rdb:~# rpm -qa | grep libgcc
libgcc1-4.6.0-r0.ppc603e
libgcc-s-dev-4.6.0-r0.ppc603e
--------------
Files installed by libgcc-s-dev-4.6.0-r0.ppc603e:
root@mpc8315e-rdb:~# rpm -ql libgcc-s-dev-4.6.0-r0
/lib
/lib/libgcc_s.so</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13665</commentid>
    <comment_count>9</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-05-10 18:49:33 +0000</bug_when>
    <thetext>thanks liang li, clearly the libgcc-dev package is missing the crt*.o files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13666</commentid>
    <comment_count>10</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-05-10 18:52:32 +0000</bug_when>
    <thetext>Also it is getting mixed with gcc 4.6.0 
# rpm -qa | grep gcc
libgcc1-4.6.0-r0.i586
perl-module-extutils-cbuilder-platform-windows-gcc-5.12.3-r0.i586
gcc-4.5.1-r4.i586
libgcc-s-dev-4.6.0-r0.i586
gcc-symlinks-4.5.1-r4.i586

It should not be using 4.6.0 version of gcc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13667</commentid>
    <comment_count>11</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-05-10 18:57:04 +0000</bug_when>
    <thetext>I think I have fix for the bug:
diff --git a/meta/conf/distro/include/poky-default.inc b/meta/conf/distro/includ
index 91985b3..0003865 100644
--- a/meta/conf/distro/include/poky-default.inc
+++ b/meta/conf/distro/include/poky-default.inc
@@ -35,6 +35,8 @@ PREFERRED_VERSION_gcc-crosssdk-intermediate ?= &quot;${SDKGCCVERSIO
 PREFERRED_VERSION_gcc-cross-canadian ?= &quot;${GCCVERSION}&quot;
 PREFERRED_VERSION_gcc-runtime ?= &quot;${GCCVERSION}&quot;
 PREFERRED_VERSION_gcc-runtime-nativesdk ?= &quot;${SDKGCCVERSION}&quot;
+PREFERRED_VERSION_libgcc ?= &quot;${GCCVERSION}&quot;
+PREFERRED_VERSION_libgcc-nativesdk ?= &quot;${SDKGCCVERSION}&quot;
 PREFERRED_VERSION_binutils ?= &quot;${BINUVERSION}&quot;
 PREFERRED_VERSION_binutils-cross ?= &quot;${BINUVERSION}&quot;
 PREFERRED_VERSION_binutils-crosssdk ?= &quot;${BINUVERSION}&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13779</commentid>
    <comment_count>12</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-05-13 10:09:53 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e8fd633fe45ef338a45350d4414d93005a54417a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13964</commentid>
    <comment_count>13</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-05-24 19:27:48 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e8fd633fe45ef338a45350d4414d93005a54417a

With this fix, I can verify the crt*.o files are installed into target image now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>