<?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>2519</bug_id>
          
          <creation_ts>2012-05-29 19:49:00 +0000</creation_ts>
          <short_desc>mklibs: Does not work with compiler from sstate cache</short_desc>
          <delta_ts>2014-05-03 17:58:23 +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>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>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>lee_ballard</cc>
    
    <cc>meta.layer.watcher</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ndec13</cc>
    
    <cc>raj.khem</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21707</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2012-05-29 19:49:00 +0000</bug_when>
    <thetext>When using the sstate cache, mklibs fails.  Steps to reproduce:

. ./oe-init-build-env o1
Use the sstate-cache directory of ${TOPDIR}/../sstate-cache
build an image (core-image-minimal is fine)

cd ..
rm -rf o1

. ./oe-init-build-env o2
Use the same configuration as before and enable mklibs:
Enable mklibs in local.conf: MKLIBS_OPTIMIZED_IMAGES ?= &quot;all&quot;
build an image (same as before)

You should get an error:


| reducing libutil.so.1
| Command failed with status 1 : i586-wrs-linux-gcc -nostdlib -nostartfiles -shared -Wl,-soname=libutil.so.1 -uopenpty -o /space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/mklibs/dest/libutil.so.1-so /space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/lib//libutil_pic.a -Wl,--version-script=/space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/lib//libutil_pic.map -lgcc -L/space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/mklibs/dest -L/space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/X11R6/lib/ -lc
| With output:
| ERROR: Function failed: do_rootfs (see /space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/temp/log.do_rootfs.15750 for further information)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24308</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-08-22 01:02:31 +0000</bug_when>
    <thetext>So I dug into this and it seems that gcc has internally cached the sysroot from the prior build, so when mklibs calls gcc with no --sysroot set, it defaults to the one from the o1 build and fails.  If I changed change the call to mklibs scripts to include a --gcc-options with --sysroot=o2/..., then it works correctly since the --sysroot option is passed on to gcc via mklibs.

At this point, I think its a mklibs.bbclass or a mklib (the script_ bug that it does not pass --sysroot on the --gcc-options or use the --sysroot that is set on the mklibs to pass on to gcc, I am not sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24310</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2012-08-22 01:40:00 +0000</bug_when>
    <thetext>A patch to master has already been incorporated that should fix this:

oe-core: d2cd2ccea8bc4d110647ba3bd202772e5407000a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24342</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-08-22 14:35:09 +0000</bug_when>
    <thetext>Nope, I just tested this yesterday and this issue still exists, that might have solved a different issue, but not this particular one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39050</commentid>
    <comment_count>4</comment_count>
    <who name="Nicolas Dechesne">ndec13</who>
    <bug_when>2013-11-22 22:43:08 +0000</bug_when>
    <thetext>i have been debugging this issue today, and came up with the same conclusion as Saul. I have submitted the following patch

http://lists.openembedded.org/pipermail/openembedded-core/2013-November/086887.html

I could verify it solved the problem on my setup.

the patch applies to dylan, dora and master (i haven&apos;t tried older release). Since it&apos;s a bug, i hope we can get it merged on dylan and dora since i am using both for products.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39052</commentid>
    <comment_count>5</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2013-11-23 02:17:49 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; i have been debugging this issue today, and came up with the same conclusion
&gt; as Saul. I have submitted the following patch
&gt; 
&gt; http://lists.openembedded.org/pipermail/openembedded-core/2013-November/
&gt; 086887.html

This patch look ok to me.

&gt; 
&gt; I could verify it solved the problem on my setup.
&gt; 
&gt; the patch applies to dylan, dora and master (i haven&apos;t tried older release).
&gt; Since it&apos;s a bug, i hope we can get it merged on dylan and dora since i am
&gt; using both for products.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43100</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-05-03 17:58:23 +0000</bug_when>
    <thetext>This was fixed with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=6cdecac4ef4b43917935aa0f5fb80548237ea92b</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>