zsh-workers
 help / color / mirror / code / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-workers@zsh.org
Subject: Re: loading of module's dependencies broken with '-z now' in LDFLAGS
Date: Thu, 05 Nov 2015 13:39:20 +0100	[thread overview]
Message-ID: <5294509.qASjPjACe2@kdudka.brq.redhat.com> (raw)
In-Reply-To: <20151105121744.0d407139@pwslap01u.europe.root.pri>

On Thursday 05 November 2015 12:17:44 Peter Stephenson wrote:
> On Thu, 5 Nov 2015 11:58:29 +0000
> 
> Peter Stephenson <p.stephenson@samsung.com> 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


  reply	other threads:[~2015-11-05 12:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 10:59 Kamil Dudka
2015-11-05 11:58 ` Peter Stephenson
2015-11-05 12:17   ` Peter Stephenson
2015-11-05 12:39     ` Kamil Dudka [this message]
2015-11-05 12:47       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5294509.qASjPjACe2@kdudka.brq.redhat.com \
    --to=kdudka@redhat.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).