From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27486 invoked by alias); 5 Nov 2015 11:58:38 -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: 37066 Received: (qmail 11383 invoked from network); 5 Nov 2015 11:58:37 -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 X-AuditID: cbfec7f5-f794b6d000001495-71-563b44696332 Date: Thu, 05 Nov 2015 11:58:29 +0000 From: Peter Stephenson To: Kamil Dudka , zsh-workers@zsh.org Subject: Re: loading of module's dependencies broken with '-z now' in LDFLAGS Message-id: <20151105115829.2bb4b3d8@pwslap01u.europe.root.pri> In-reply-to: <5256226.5racBSergM@kdudka.brq.redhat.com> References: <5256226.5racBSergM@kdudka.brq.redhat.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t/xq7qZLtZhBg82iVnMON/PaHGw+SGT A5PH+31X2TxWHfzAFMAUxWWTkpqTWZZapG+XwJUx89Vy1oJlAhXH39g1MLbzdjFyckgImEg8 v7afCcIWk7hwbz1bFyMXh5DAUkaJAwe/M0I4DUwSaz7vhHK2MkrsXnoJrIVFQFXiytUjYDab gKHE1E2zGUFsEQELiY8/TrCD2MICvhITWnpZuxg5OHgF7CW2/RIECXMKmEts3dfEDGILCZhJ /D72GKycX0Bf4urfT1AX2UvMvHIGbCSvgKDEj8n3WEBsZgEtic3bmlghbHmJzWveQs1Rl7hx dzf7BEahWUhaZiFpmYWkZQEj8ypG0dTS5ILipPRcI73ixNzi0rx0veT83E2MkDD+uoNx6TGr Q4wCHIxKPLwG1VZhQqyJZcWVuYcYJTiYlUR4pWStw4R4UxIrq1KL8uOLSnNSiw8xSnOwKInz ztz1PkRIID2xJDU7NbUgtQgmy8TBKdXA6JbwPfjb71k3PH7uCTnJc69eJPSFmteroxbN3s7h H/1MWVbFfvWTEXwR0zLxqYBDCIe/2QM3K5vP1yc+T+8Tf3rlucUL9pXmO9VUemyy2MUN5scb PtT4pbZ1h/K2lzN9Zz7TPJBbuNRVvoMpe9WVgo2Gn2YbFe5yFcm+ayBa4V66Kkhr44UYJZbi jERDLeai4kQAR3TRkl8CAAA= On Thu, 5 Nov 2015 11:59:42 +0100 Kamil Dudka wrote: > the build system of Fedora recently started to call linker with '-z now'. > The ld(1) man page regarding this option says: > > "When generating an executable or shared library, mark it to tell the > dynamic linker to resolve all symbols when the program is started, or > when the shared library is linked to using dlopen, instead of deferring > function call resolution to the point when the function is first called." > > This breaks loading of zsh modules that depend on other zsh modules. > For instance, the following command fails: > > $ zsh -c 'zmodload zsh/zftp' > zsh:1: failed to load module `zsh/zftp': /usr/lib64/zsh/5.1.1/zsh/zftp.so: > undefined symbol: freehostent [from zsh/net/tcp]. There is certainly nothing in the current zsh build system as set up for Linux that does this; however, there is some evidence that it got partly thought about. To pursue this example (I think it generalises), the Src/Modules/zftp.mdd file that defines moddeps="zsh/net/tcp" to say that zftp depends on zsh/net/tcp. In Src/Modules/Makefile, this results in (together with the implicit dependency on the main shell): LINKMODS_zftp = tcp.$(DL_EXT) $(dir_top)/Src/libzsh-$(VERSION).$(DL_EXT) So far so good --- however, LINKDMODS_zftp isn't actually mentioned again. A bit of research says that's because configuration says we should use the alternative (empty) NOLINKMODS_zftp; the LINKMODS version is only defined to be used for a few OSes in configure.ac. I guess we need to generate something like LINKMODS_whatever that tells it to link against the .so's as libraries? If someone can say definitively, it might not be too hard to implement. > ... whereas the following command succeeds: > > $ zsh -c 'zmodload zsh/net/tcp && zmodload zsh/zftp' > > Do I understand it correctly that the only solution is to tweak the build > system not to use '-z now' while linking zsh modules? For now, that's probably the case. pws