Reducing library dependancies

Michael Pyne mpyne at purinchu.net
Fri Aug 15 01:58:14 BST 2008


On Thursday 14 August 2008, Alexander Neundorf wrote:
> On Friday 15 August 2008, Thiago Macieira wrote:
> > With --as-needed, we could make the decision to keep it. If QtXml isn't
> > used by the target, then the linker drops the dependency.
>
> So with --as-needed unused but listed libraries are not linked directly ?
> Dirk said something about some issues with that, it sounded quite
> complicated, I don't remember the details. Are there known issues with this

Yes there were issues IIRC (otherwise it would already be the default I'm 
sure.

I believe it could lead to breakage in situations where a program depends on 
two libraries, libA and libB, but only directly specified libA on the link 
line, since libA would link against libB although it doesn't actually require 
it (i.e. lots of KDE stuff linking against Qt and X11 even though Qt is 
sufficient).

But with --as-needed the linker would notice that libA doesn't actually use 
libB and drop the link to it.  And then the program would fail to link because 
they forgot to include libB since the link command used to work without it.

I'm sure there were other issues but that's the one I can think of at this 
time.

Regards,
 - Michael Pyne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080814/99c56f07/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080814/99c56f07/attachment.sig>


More information about the kde-core-devel mailing list