Fwd: Re: Fix for --as-needed

David Faure faure at kde.org
Mon Nov 22 13:39:39 GMT 2004


On Monday 22 November 2004 00:23, Thiago Macieira wrote:
> My solution consists in:
> 1) adding the --enable-new-dtags flag to the linker, if supported. This 
> makes GNU ld emit RUNPATH directives as well as RPATH. The consequence is 
> twofold:
> 	a) RPATH is ignored
> 	b) RUNPATH is overrideable by LD_LIBRARY_PATH at run-time
Wow, very nice. [This is how RPATH should always have been IMHO].

> 2) making libtool's stub script use LD_LIBRARY_PATH as well as relinking. 
> (In truth, it probably doesn't have to relink, but I didn't want to make 
> such an intrusive change)
A libtool that doesn't need to relink anymore - that would be so awesome...

Thanks a lot - I knew there was a way to do this cleanly :)

Should we use $RUNPATH even independently from the -as-needed stuff?
I think it makes it much easier to have several versions of KDE around, if you
can really control which one is found at runtime (using LD_LIBRARY_PATH)
without the "hardcoded into the libs/bins" RPATHs taking precedence.
But well, since this fix makes it ok again to have -as-needed on by default,
it probably doesn't matter much what happens when disabling it.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list