Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Library linkage portability?



On Sunday 29 April 2007, Bart Schaefer wrote:
> On Apr 29,  5:34am, Phil Pennock wrote:
> }
> } Can someone please educate me as to the issues, or have I summed it up?
> } What about the stranger platforms, AIX etc?
>
> Search the zsh-workers archives for the years 1996-1998 for the terms
> "dynamic;link" "dynamic;load" and "dynamic;library".  E.g.:
>
>     http://tinyurl.com/3355m6
>
> In particular start here:
>
>     http://tinyurl.com/37gaqe
>
> My recollection is that Cygwin and some other environments require not
> that dynamic modules be linked from the main executable, but that they
> be linked from another library, which is why the zsh/main module exists.
>

More precisely - some systems cannot export dynamic symbols (necessary for 
run-time linking) from main executable; they can be exported only from 
another dynamic module; library just being special case of dynamic module. I 
have been using such system for some time. Because on Win32 you actually link 
DLL against stub for another DLL, and such stub exists for DLL only, not for 
exe, I guess it is true for Cygwin as well (modern Cygwin can generate stub 
on the fly, but it is still required).

Also there are systems that do not support chained libraries (i.e. main 
executable requires library liba.so which requires libb.so. In this case 
libb.so won't be loaded unless explicitly listed during linking of main 
executable. Whether linker does not put NEEDED entries or rtld ignores them, 
does not matter - I believe on my system it was the latter). That is actually 
what gave rise to something like "pkgcofig --libs ..."; also libtool should 
cope with this too - it has full information about all requirements and links 
main executable against all need libraries on systems that need it.

I do not know if you can find any such system in the wild today.

-andrey

Attachment: pgpqHLT9mdbLz.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author