[Development] RPATH in libraries

Konrad Rosenbaum konrad at silmor.de
Tue Aug 6 23:22:10 CEST 2013


On Tuesday 06 August 2013 17:10:31 Thiago Macieira wrote:
> On terça-feira, 6 de agosto de 2013 15:41:21, Konrad Rosenbaum wrote:
> > On Sunday 04 August 2013 18:51:10 Thiago Macieira wrote:
> > > On domingo, 4 de agosto de 2013 10:20:51, Dmitry Ashkadov wrote:
> > > > LDD finds library using RPATH first of all, so, for local installed
> > > > Qt5
> > > 
> > > That's why RPATH was deprecated and replaced with RUNPATH.
> > 
> > Stupid question: is there a reason the default Makefile generated by
> > qmake does not include this:
> > QMAKE_LFLAGS += -Wl,--enable-new-dtags

Ok, I found the answer to my own question: DT_RUNPATH is radically different 
from DT_RPATH - if it was only evaluated after $LD_LIBRARY_PATH it would not 
be a problem, but it also does not apply to libraries loaded by the libraries 
I found in this RUNPATH. So if I open a plugin that does not have RUNPATH set, 
but requires Qt it will attempt to load Qt not from my RUNPATH, but from the 
system directories. This will likely crash my application.

See: http://blog.qt.digia.com/blog/2011/10/28/rpath-and-runpath/

> Yes. It's not our job to do that. We should assume a decent linker from the
> system.

After reading through lots of mostly half-complete documentation I find that I 
define "decent" differently from what I thought a few hours ago.

> The question is: why does your system linker not enable the new dtags from
> 10-15 years ago?

That would be a question for the Debian maintainers. Or probably the binutils 
maintainers (Debian seems to tend to stay with upstream in this case, I didn't 
check very thoroughly though).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130806/18399958/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130806/18399958/attachment.sig>

More information about the Development mailing list