Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
1.5.1
-
None
-
Gentoo Linux
-
646ae60164d61d85d5773309fe956dde7d4b2909
Description
The standard Qt modules always append the location of the Qt libraries to the rpath. If an application is build against the system Qt version than this path usually contains most installed libraries, not just qt (eg. /usr/lib).
As rpath is always searched first, this basically disables support for shadowing anything in /usr/lib with $LD_LIBRARY_PATH or /etc/ld.so.conf.
As an example: gentoo handles multiple libGL.so libraries via ld.so.conf, with the mesa version as fallback in /usr/lib. Due to the rpath, anything build with qbs will always find the mesa fallback first, instead of using the configured opengl implementation.
As a workaround qbs can be instructed to not write any rpath at all - but this also disables any legitimate use of rpaths in my build (used for non-installed libraries).
This workaround does not help when using qt-creator, as the qbs integration also adds the qt library path into $LD_LIBRARY_PATH when lunching the build result.
The qt modules should only use rpath if the libraries are not installed in a standard search path (at least in linux).