Bug 5339

Summary: Generated toolchain not working outside default installation path
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Diego Sueiro <diego.sueiro>
Component: devtools / tool chainAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium+ CC: jessica.zhang, meta.mr.watcher, meta.watcher
Version: 1.4.2   
Target Milestone: 1.4.2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Diego Sueiro 2013-10-11 12:49:44 UTC
When installing a generated toolchain outside of it's default path all binaries have the default absolute path to the dynamic loader (/opt/poky/...) hardcoded in the elf INTERP section.
This issue was detected when trying to use the meta-toolchain-qte with QT Creator and was reproduced on danny and dylan branches.

Here is some additional info about it:
https://lists.yoctoproject.org/pipermail/yocto/2013-October/018637.html
Comment 1 Laurentiu Palcu 2013-10-28 13:44:22 UTC
Apparently, the paths where QT looks for stuff (libraries, headers, etc) are hard-coded in qmake. A simple 'strings qmake | grep poky' reveals the following:

qt_demopath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/demos
qt_xmplpath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/examples
qt_trnspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/translations
qt_datapath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr
qt_impspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/imports
qt_plugpath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/plugins
qt_binspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin
qt_libspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib
qt_hdrspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/include
qt_docspath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/doc
qt_prfxpath=/opt/poky/1.5+snapshot/sysroots/x86_64-pokysdk-linux/usr

These can also be seen by executing 'qmake -query'. Luckily, QT allows overriding these paths by providing a qt.conf file in the same directory with qmake. The following qt.conf made it work (replace PATH_TO_MY_SDK_DIR with the path to your sdk installation dir):
-------------
[Paths]
Prefix = <PATH_TO_MY_SDK_DIR>/sysroots/x86_64-pokysdk-linux/usr
-------------

qt-creator didn't complain anymore. I'll prepare a fix for this.
Comment 2 Laurentiu Palcu 2013-10-28 15:48:04 UTC
Sent a fix on the oe-core mailing list.