<?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>6174</bug_id>
          
          <creation_ts>2014-04-17 18:51:06 +0000</creation_ts>
          <short_desc>rpath fixup broken after 6fcb960: chrpath: Improve crazy code</short_desc>
          <delta_ts>2014-05-11 12:50:52 +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>deployment</component>
          <version>1.6.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.7</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt Cowell">matt.cowell</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jessica.zhang</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>42719</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Cowell">matt.cowell</who>
    <bug_when>2014-04-17 18:51:06 +0000</bug_when>
    <thetext>After this commit, here is an example output from log.do_populate_sysroot for file-native.  Note that the RPATH is fixed up to something completely bogus (the difference between the workdir sysroot-destdir and the native sysroot), which is causing the native utilities to use the libraries from the build machine rather than the sysroot.

NOTE: Processing directory /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin
NOTE: Current rpath for /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin/file.real is /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/lib:/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/lib
NOTE: Setting rpath for /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin/file.real to $ORIGIN/../../../../../../../../../../../../../../../sysroots/x86_64-linux/usr/lib:$ORIGIN/../../../../../../../../../../../../../../../sysroots/x86_64-linux/lib

Reverting this commit, the proper behavior is restored:
NOTE: Processing directory /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin
NOTE: Current rpath for /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin/file.real is /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/lib:/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/sysroots/x86_64-linux/lib
NOTE: Setting rpath for /var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp/tmp/sysroots/x86_64-linux/usr/bin/file.real to $ORIGIN/../../usr/lib:$ORIGIN/../../lib</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42721</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2014-04-17 19:22:07 +0000</bug_when>
    <thetext>based on comments the commit is:

commit 6fcb96076ca60ef30062fda0ff8308cc840ab07d
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Tue Nov 26 22:14:47 2013 +0000

    chrpath: Improve crazy code
    
    The current code is a little bit overcomplicated, deficient and also
    possibly broken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42722</commentid>
    <comment_count>2</comment_count>
      <attachid>1918</attachid>
    <who name="Matt Cowell">matt.cowell</who>
    <bug_when>2014-04-17 19:32:47 +0000</bug_when>
    <thetext>Created attachment 1918
Proposed patch to handle .. in rootdir path

I found that this is caused when there is a &apos;..&apos; in the rootdir path, as in &quot;/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/&quot; in my case.  I&apos;ve attached a proposed patch that fixes the issue by normalizing the rootdir path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43189</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-05-08 15:14:47 +0000</bug_when>
    <thetext>Patch looks good, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43241</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-05-11 12:50:52 +0000</bug_when>
    <thetext>Merges, thanks for the patch! http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=1b82c73df43500d64dc49a9fb4a2546d88a5f95e</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>1918</attachid>
            <date>2014-04-17 19:32:47 +0000</date>
            <delta_ts>2014-04-17 19:32:47 +0000</delta_ts>
            <desc>Proposed patch to handle .. in rootdir path</desc>
            <filename>0001-chrpath-properly-handle-rootdir-with-.-in-path.patch</filename>
            <type>text/plain</type>
            <size>1067</size>
            <attacher name="Matt Cowell">matt.cowell</attacher>
            
              <data encoding="base64">RnJvbSBiMGYzZjNjMzZiYThhZTQxZmY5NGE3Mjg5N2UwMzFjOGVjNjVhOTZhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXR0IENvd2VsbCA8bWF0dC5jb3dlbGxAbnNuLmNvbT4KRGF0
ZTogVGh1LCAxNyBBcHIgMjAxNCAxNDoyMzoxMyAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIGNocnBh
dGg6IHByb3Blcmx5IGhhbmRsZSByb290ZGlyIHdpdGggJy4uJyBpbiBwYXRoCgpXaGVuIHRoZXJl
IGlzIGEgJy4uJyBpbiB0aGUgcm9vdGRpciBwYXRoLCByb290ZGlyIHdpbGwgbm90IGJlIGEgc3Vi
c3RyaW5nIG9mCmZwYXRoLiAgVGhpcyBjYXVzZXMgYW4gaW5jb3JyZWN0IHJwYXRoIG9mIHRoZSBk
aWZmZXJlbmNlIGJldHdlZW4gdGhlIHdvcmtkaXIKYW5kIHRoZSBzeXNyb290IHRvIGJlIGNvbXB1
dGVkLCB3aGljaCBpcyBpbmNvcnJlY3QuICBOb3JtYWxpemluZyBiYXNlZGlyCmZpeGVzIHRoaXMg
aXNzdWUuCi0tLQogbWV0YS9jbGFzc2VzL2NocnBhdGguYmJjbGFzcyB8ICAgIDEgKwogMSBmaWxl
IGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspCgpkaWZmIC0tZ2l0IGEvbWV0YS9jbGFzc2VzL2NocnBh
dGguYmJjbGFzcyBiL21ldGEvY2xhc3Nlcy9jaHJwYXRoLmJiY2xhc3MKaW5kZXggN2JkYjFiOS4u
Nzc2NTAyMCAxMDA2NDQKLS0tIGEvbWV0YS9jbGFzc2VzL2NocnBhdGguYmJjbGFzcworKysgYi9t
ZXRhL2NsYXNzZXMvY2hycGF0aC5iYmNsYXNzCkBAIC02MSw2ICs2MSw3IEBAIGRlZiBwcm9jZXNz
X2ZpbGVfZGFyd2luKGNtZCwgZnBhdGgsIHJvb3RkaXIsIGJhc2VwcmVmaXgsIHRtcGRpciwgZCk6
CiBkZWYgcHJvY2Vzc19kaXIgKHJvb3RkaXIsIGRpcmVjdG9yeSwgZCk6CiAgICAgaW1wb3J0IHN0
YXQKIAorICAgIHJvb3RkaXIgPSBvcy5wYXRoLm5vcm1wYXRoKHJvb3RkaXIpCiAgICAgY21kID0g
ZC5leHBhbmQoJyR7Q0hSUEFUSF9CSU59JykKICAgICB0bXBkaXIgPSBvcy5wYXRoLm5vcm1wYXRo
KGQuZ2V0VmFyKCdUTVBESVInKSkKICAgICBiYXNlcHJlZml4ID0gb3MucGF0aC5ub3JtcGF0aChk
LmV4cGFuZCgnJHtiYXNlX3ByZWZpeH0nKSkKLS0gCjEuNy4xMC4xCgo=
</data>
<flag name="copyright-waived"
          id="7"
          type_id="2"
          status="+"
          setter="matt.cowell"
    />
          </attachment>
      

    </bug>

</bugzilla>