<?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>6465</bug_id>
          
          <creation_ts>2014-06-18 19:46:39 +0000</creation_ts>
          <short_desc>Enabling multilib does not taint all sstate content</short_desc>
          <delta_ts>2014-11-07 14:54:22 +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>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.8</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Gortmaker">paulg</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</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>44077</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Gortmaker">paulg</who>
    <bug_when>2014-06-18 19:46:39 +0000</bug_when>
    <thetext>Enabling multlib in conf/local.conf with:

 require conf/multilib.conf
 MULTILIBS = &quot;multilib:lib32&quot;
 DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;

as per the docs https://wiki.yoctoproject.org/wiki/Multilib

needs to taint all shared library binaries living in sstate.  Otherwise you get hard to diagnose behaviour where those binaries won&apos;t execute or even be probable with &quot;ldd&quot;.

Here is an example, using the stat binary from the &quot;stat&quot; package:

-------------------------
bash-4.3# cd /bin
bash-4.3# ./stat.stat
bash: ./stat.stat: No such file or directory
bash-4.3# ls -l ./stat.stat
-rwxr-xr-x 1 root root 16712 Jun 17 14:30 ./stat.stat
bash-4.3# ldd ./stat.stat
/usr/bin/ldd: line 117: ./stat.stat: No such file or directory
bash-4.3# ln -s /lib64/ld-linux-x86-64.so.2  /lib/ld-linux-x86-64.so.2  #  HACK!
bash-4.3# ./stat.stat
Usage: ./stat.stat [-l] [-f] [-s] [-v] [-h] [-t] [-c format] file1 [file2 ...]
bash-4.3# ldd ./stat.stat
	linux-vdso.so.1 (0x00007fff14361000)
	libc.so.6 =&gt; /lib64/libc.so.6 (0x000000370f600000)
	/lib/ld-linux-x86-64.so.2 (0x000000370f200000)
bash-4.3# 
---------------------

compare the last line from ldd to that from a recompiled stat from a fresh build with all sstate purged:

--------------------
bash-4.3# ldd ./stat.stat-recompiled 
	linux-vdso.so.1 (0x00007fff6a5fe000)
	libc.so.6 =&gt; /lib64/libc.so.6 (0x000000370f600000)
	/lib64/ld-linux-x86-64.so.2 (0x000000370f200000)
bash-4.3# 
--------------------

Note the last line in each ldd output and the lib vs lib64 prefix.

Similarly, if anyone goes from multilib enabled to multilib disabled, all binaries using dynamic library need their sstate tainted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45887</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-09-26 10:14:28 +0000</bug_when>
    <thetext>I&apos;ve looked into this and I can&apos;t see anything wrong. I started with a qemux86-64 build with no multilib enabled. This installed libraries into /lib/ as expected.

I then added the lines you mentioned. This causes 64 bit to be installed into lib64 as expected. When I compared the signatures for the stat task I see:

$ bitbake-diffsigs tmp/stamps/core2-64-poky-linux/stat/3.3-r0.do_populate_sysroot.sigdata.2* tmp/stamps/core2-64-poky-linux/stat/3.3-r0.do_populate_sysroot.sigdata.b*
basehash changed from 113c64dfdd151517f1863005203894a5 to 2cf30b9c6750056d063202a5c728857d
Variable baselib value changed from &apos;lib&apos; to &apos;lib64&apos;

i.e. the hash did change and it did so since baselib changed. This would trigger a rebuild (the 2* and b* hashes were before and after the change).

I did find an unrelated problem where another change elsewhere triggered a rebuild of everything and will send a separate patch for that.

So as far as I can tell, sstate is tainted for multilib?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45891</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-09-26 11:17:01 +0000</bug_when>
    <thetext>On a hunch, I tried looking at the actual build output and you are correct, it does not update correctly after the multilib changes. The reason is quite simple too, stat doesn&apos;t have a separate source and build directory so the system just goes into the directory and does &quot;make&quot;. The core system libs and loader shims have changed but make doesn&apos;t realise than and the binary isn&apos;t rebuilt.

So sstate is perfectly fine, the reuse of the existing build directory is problematic though and its effectively a make issue.

Starting from a clean tmpdir obviously avoids the problem. Using something which has separate build support like autotools (B != S) also avoids the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46857</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-11-07 14:54:13 +0000</bug_when>
    <thetext>The following patches have been merged to various key classes to try and improve this:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=444ae98131f7f9e962d102f408eb867ab53a452a
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=6bd2d9d395fe7c97a0a9645ca9379b366bb64afa
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c1f4b1f76627c76f23c2037a1e9dad10a31ec258
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d5881b7b94b195ad3858d46992ba6edbb2c95f31

Its probably not perfect but it is probably as good as we can get without complete removal of the source and the unpack/patch again.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>