<?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>10282</bug_id>
          
          <creation_ts>2016-09-14 23:20:04 +0000</creation_ts>
          <short_desc>Prelink: doesn&apos;t work on qemux86-64 on the qemu target</short_desc>
          <delta_ts>2016-09-28 09:38:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Cross-prelink</product>
          <component>cross-prelink</component>
          <version>2.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>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="brian avery">brian.avery</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>richard.purdie</cc>
    
    <cc>yp.cp.watcher</cc>
    
    <cc>yp.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>66166</commentid>
    <comment_count>0</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-09-14 23:20:04 +0000</bug_when>
    <thetext>If I include prelink on the image by adding 
IMAGE_INSTALL_append= &quot; prelink  &quot; 

and I try to run prelink on the qemux86-64 target it fails with:
root@qemux86-64:~# prelink --verify --md5 /bin/busybox.nosuid                                                                              
prelink: /bin/busybox.nosuid: Using /lib/ld-linux-x86-64.so.2, not /lib64/ld-linux-x86-64.so.2 as dynamic linker 
prelink: /bin/busybox.nosuid disappeared while running --verify

On qemux86 it works correctly and looks like:
root@qemux86:~# prelink --verify --md5 /bin/busybox.nosuid                      
29fa665f1beb95a98422ef522dec2b3a  /bin/busybox.nosuid</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66215</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-09-15 15:23:34 +0000</bug_when>
    <thetext>Can you please retest and enable the LSB library paths?

Specifically:

require conf/multilib.conf
MULTILIBS = &quot;&quot;

I suspect the problem is that not using proper LSB paths is confusing the prelinker&apos;s internal RTLD.  In the cross install, there is code that is specifically passing in the libc  ld.so path into the RTLD to avoid that issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66233</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-09-15 21:57:42 +0000</bug_when>
    <thetext>Tried/Verified.

Adding:

require conf/multilib.conf
MULTILIBS = &quot;&quot;

to meta/classes/image-prelink.bbclass

resulted in a qemux86-64 target that could successfully run :
prelink --verify --md5 /bin/busybox.nosuid

It also continued to work for qemux86.
Mark, is this generic  enough to be ok as a patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66255</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-09-16 16:20:19 +0000</bug_when>
    <thetext>OE will not accept the change.  They want the ability to specify an arbitrary (within reason) libdir, that may not conform to LSB guidelines.

The prelink RTLD utility is expecting LSB style path names to the ld.so executable.  If this is not present, then the (target) absolute path to the ld.so must be passed in (similarly to how the cross processing does) as:

prelink &lt;args&gt; --dynamic-linker &lt;path to loader&gt;

The &apos;linuxloader.bbclass&apos; has a list of the known loaders paths.

One way to deal with this could be a wrapper script to prelink (for the target)... another solution could simply be to document what is required.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66269</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-09-16 20:24:54 +0000</bug_when>
    <thetext>Hmm, I guess I&apos;d lean toward the docs as I shy away from obscuring things like this.

Something is not working when I try the change we would document, however.
-----
First I removied: 
require conf/multilib.conf
MULTILIBS = &quot;&quot;
------

Then I got the expected:
root@qemux86-64:~# prelink --verify --md5 /bin/bash                    
prelink: /bin/bash: Using /lib/ld-linux-x86-64.so.2, not /lib64/ld-linux-x86-64.so.2 as dynamic linker
prelink: /bin/bash disappeared while running --verify

------
Then I tried this
root@qemux86-64:~# prelink --verify --md5 --dynamic-linker=/lib/ld-linux-x86-64.so.2  /bin/bash                     
prelink: /bin/bash: Could not parse `/usr/sbin//prelink-rtld: error while loading shared libraries: libdl.so.2&apos;                     
prelink: /bin/bash: at least one of file&apos;s dependencies has changed since prelinking  

and it still failed for me.  Is there something additional I should specify on the target to have it work there ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66674</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-09-28 09:38:09 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=47abf987ad3bde11d1019596a71028560535e4cc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>