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 Thu, 5 Nov 2015 13:39:20 +0100
Kamil Dudka <kdudka@xxxxxxxxxx> wrote:
> 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.

In the short term, that's the best bet.  (I now realise I got confused
and resolution at dlopen() is indeed the point, as it said in the manual
you quoted; resolution within the build system is irrelevant.)

I've just done a little more research while waiting for some machines to
spring back to life and if we *did* want to improve things with "-z
now", I think the answer is that in a GNU environment we can give the
module setup_() function the "constructor" attribute (and finish_ the
"desctructor" attribute).  Then the load of dependent modules happens
before dlopen()s final checks (I think --- I haven't tested this).  Then
we don't call setup_() and finish_() by hand.

I don't think that gains us all that much, however, and while it looks
easy to implement probing the configuration to see if it supports it is
a bit hairier.  So I'm not sure it's worth the effort.

pws



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