From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23116 invoked by alias); 5 Nov 2015 12:39:26 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37068 Received: (qmail 1000 invoked from network); 5 Nov 2015 12:39:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 From: Kamil Dudka To: Peter Stephenson 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 Message-ID: <5294509.qASjPjACe2@kdudka.brq.redhat.com> User-Agent: KMail/4.14.10 (Linux/4.2.5-300.fc23.x86_64; KDE/4.14.13; x86_64; ; ) In-Reply-To: <20151105121744.0d407139@pwslap01u.europe.root.pri> References: <5256226.5racBSergM@kdudka.brq.redhat.com> <20151105115829.2bb4b3d8@pwslap01u.europe.root.pri> <20151105121744.0d407139@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 On Thursday 05 November 2015 12:17:44 Peter Stephenson wrote: > On Thu, 5 Nov 2015 11:58:29 +0000 > > Peter Stephenson 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