Bug 6174 - rpath fixup broken after 6fcb960: chrpath: Improve crazy code
Summary: rpath fixup broken after 6fcb960: chrpath: Improve crazy code
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.6.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.7
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-04-17 18:51 UTC by Matt Cowell
Modified: 2014-05-11 12:50 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Proposed patch to handle .. in rootdir path (1.04 KB, patch)
2014-04-17 19:32 UTC, Matt Cowell
matt.cowell: copyright-waived+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Cowell 2014-04-17 18:51:06 UTC
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
Comment 1 Mark Hatle 2014-04-17 19:22:07 UTC
based on comments the commit is:

commit 6fcb96076ca60ef30062fda0ff8308cc840ab07d
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
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.
Comment 2 Matt Cowell 2014-04-17 19:32:47 UTC
Created attachment 1918 [details]
Proposed patch to handle .. in rootdir path

I found that this is caused when there is a '..' in the rootdir path, as in "/var/fpwork/qdpx86/nsn-yocto/build_lrc-lsp-k2/../build_lrc-lsp/tmp/work/x86_64-linux/file-native/5.16-r0/sysroot-destdir/" in my case.  I've attached a proposed patch that fixes the issue by normalizing the rootdir path.
Comment 3 Richard Purdie 2014-05-08 15:14:47 UTC
Patch looks good, thanks.
Comment 4 Richard Purdie 2014-05-11 12:50:52 UTC
Merges, thanks for the patch! http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=1b82c73df43500d64dc49a9fb4a2546d88a5f95e