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

Re: loading of module's dependencies broken with '-z now' in LDFLAGS



On Thursday 05 November 2015 12:17:44 Peter Stephenson wrote:
> On Thu, 5 Nov 2015 11:58:29 +0000
> 
> Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> > I guess we need to generate something like LINKMODS_whatever that
> > tells it to link against the .so's as libraries?
> 
> Hmm... actually, maybe it's not that simple.
> 
> The usually implication with a DLL is that it'll be found automatically
> by the OS, but that's not what zsh is doing, which is:
> 
> - get instruction to load zsh/zftp
> - Open this with dlopen().  Note we have RTLD_LAZY defined to
>   support the following.
> - Run setup_().
> - This executes
>     return (require_module("zsh/net/tcp", NULL) == 1);
> - This causes us to load tcp.so.
> - When we enounter any missing link from tcp.so, it gets resolved.
> 
> I don't know enough about DLLs to say whether resolving the links when
> zftp.so is created means that dlopen() now expects to be able to load
> tcp.so itself, in which case it's going to be problematic.
> 
> I'd suspect the "-z now" business isn't really designed for use with
> the dlopen RTLD_LAZY flag?
> 
> pws

That was my original impression too.  Thanks for the detailed analysis!
I will just tweak our build system not to use the '-z now' linker flag
for zsh modules.

Kamil



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