<?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>1833</bug_id>
          
          <creation_ts>2011-12-13 15:01:21 +0000</creation_ts>
          <short_desc>binutils: Should not detect  locally built libraries when building host tools</short_desc>
          <delta_ts>2012-01-03 09:32:55 +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>1.2</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.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Saul Wold">sgw</reporter>
          <assigned_to name="Nitin Kamble">nitin.a.kamble</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>17627</commentid>
    <comment_count>0</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-12-13 15:01:21 +0000</bug_when>
    <thetext>This problem appears when the Host binutils version and arch matches that of the version we are building. To reproduce this with the bernard (binutils_2.21.bb) and OpenSuSe 11.4 which binutils-2.21-13.1.x86_64.

The problem is when the sysinfo (host tool) is built within bintuils-2.21/build.blah/binutils directory, it gets an LD_LIBRARY_PATH that includes locally built libraries that are not compatible with the host system libraries.

This command will reproduce the problem directly (clearly you need to modify the directories on for your system).

LD_LIBRARY_PATH=/srv/home/swold/bernard/build/tmp/work/x86_64-poky-linux/binutils-2.21-r0/binutils-2.21/build.x86_64-poky-linux.x86_64-poky-linux/./bfd/.libs:/srv/home/swold/bernard/build/tmp/work/x86_64-poky-linux/binutils-2.21-r0/binutils-2.21/build.x86_64-poky-linux.x86_64-poky-linux/./prev-bfd/.libs:/srv/home/swold/bernard/build/tmp/work/x86_64-poky-linux/binutils-2.21-r0/binutils-2.21/build.x86_64-poky-linux.x86_64-poky-linux/./opcodes/.libs:/srv/home/swold/bernard/build/tmp/work/x86_64-poky-linux/binutils-2.21-r0/binutils-2.21/build.x86_64-poky-linux.x86_64-poky-linux/./prev-opcodes/.libs:/srv/home/swold/bernard/build/tmp/sysroots/x86_64-linux/usr/bin/../lib/pseudo/lib:/srv/home/swold/bernard/build/tmp/sysroots/x86_64-linux/usr/bin/../lib/pseudo/lib strace -s 8192 -f -o as_fail.out /usr/bin/as -Qy --64 -o sysinfo.o sysinfo.s

The libbfd-2.21.so and libopcodes-2.21.so are opened from the bfd/.libs and opcodes/.libs local build.

The build.blah/Makefile (which is generated from Makefile.in) has settings for a HOST_LIB_PATH which may not be correct, that a starting point for this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17633</commentid>
    <comment_count>1</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-13 16:45:26 +0000</bug_when>
    <thetext>Saul, Josh, I wonder why it does not hit non-suse x86-64 hosts. If you know any insight let me know.

Thanks,
Nitin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17634</commentid>
    <comment_count>2</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-13 16:48:06 +0000</bug_when>
    <thetext>I guess it is coming from the matching binutils version on the host.
Nitin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17642</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-12-14 09:40:42 +0000</bug_when>
    <thetext>Correct, on other hosts, the binutils is either an older version or is installed using a different version or extension for example on ubuntu 2.21.53.20110810-0ubuntu5 had a date in the version string and therefore is not a match.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17776</commentid>
    <comment_count>4</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-20 23:40:59 +0000</bug_when>
    <thetext>more findings:
the problem is wrong LD_LIBRARIES_PATH while running distro gcc.

poky sets : CC_FOR_BUILD = gcc
which is correct, a distro gcc for compiling buildtime tools.

And we have setup LD_LIBRARIES_PATH including build sysroots for do_compile, 

The solution is to not pass our LD_LIBRARIES_PATH while executing distro binaries.

This commit for fixing this issue is mailed to yocto mailing list:

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=nitin/bugfix&amp;id=6bd4afcd3f351bb92e2573d487b135c965fce0aa</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17803</commentid>
    <comment_count>5</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-21 17:36:14 +0000</bug_when>
    <thetext>sent a commit to fix this issue to mailing list</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17925</commentid>
    <comment_count>6</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-01-03 09:32:55 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ad73b121e57cbb67e8d638f6299d1ceb9a75a94f</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>