zsh-workers
 help / color / mirror / code / Atom feed
* Shared libraries on IRIX
@ 1997-02-10 10:47 Peter Stephenson
  1997-02-10 15:44 ` Andrej Borsenkow
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 1997-02-10 10:47 UTC (permalink / raw)
  To: Zsh hackers list

I hadn't been able to get shared libraries to work on IRIX and I
think the following, from the dlopen(3) manual, was the problem.

     Objects loaded by a single invocation of dlopen may import symbols from
     one another or from any object loaded automatically during program
     startup, but objects loaded by one dlopen invocation may not directly
     reference symbols from objects loaded by a different dlopen invocation.
     Those symbols may, however, be referenced indirectly using dlsym.

This fits in with my experiences: problems happen when the zle module
is loaded, which depends on another module, comp1.  The latter loads
all right but zle starts acting strangely straight away (the address
for the init routine is not sensible) and the shell crashes on entry
to zleread().

Looking at the code in the light of this, it will make things very
hard for zle add-on modules even if zle were loaded in one go.  I
suspect that (for IRIX and perhaps others) it's going to be necessary
to have zle hard-wired, at least until it's possible to restrict
modules to a pre-defined set of hooks into zle.

Anyway, I added comp1 and zle to modules-bltin by hand and everything
else seems fine with dynamic loading.  This should therefore become
the default for IRIX, even with --dynamic; I couldn't see code for it
in configure.in, though.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shared libraries on IRIX
  1997-02-10 10:47 Shared libraries on IRIX Peter Stephenson
@ 1997-02-10 15:44 ` Andrej Borsenkow
  1997-02-10 16:35   ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Borsenkow @ 1997-02-10 15:44 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

On Mon, 10 Feb 1997, Peter Stephenson wrote:

> I hadn't been able to get shared libraries to work on IRIX and I
> think the following, from the dlopen(3) manual, was the problem.
> 
>      Objects loaded by a single invocation of dlopen may import symbols from
>      one another or from any object loaded automatically during program
>      startup, but objects loaded by one dlopen invocation may not directly
>      reference symbols from objects loaded by a different dlopen invocation.
>      Those symbols may, however, be referenced indirectly using dlsym.
>

Yes; this is exactly what happens on my system (Sinix-N 5.42). dlopen()
has a flag (RTLD_GLOBAL) which should make symbols from one module
available for other dlopen() calls. zsh calls dlopen() with RTLD_GLOBAL,
but alas! it forces it to be 0 if not defined.
(Speaking about my system - RTLD_GLOBAL is supported in the next version
first :-(
 
> This fits in with my experiences: problems happen when the zle module
> is loaded, which depends on another module, comp1.  The latter loads
> all right but zle starts acting strangely straight away (the address
> for the init routine is not sensible) and the shell crashes on entry
> to zleread().
> 

Well, I get errors right away - it complaints about no being able to
resolve some symbol from comp1.

> Looking at the code in the light of this, it will make things very
> hard for zle add-on modules even if zle were loaded in one go.  I
> suspect that (for IRIX and perhaps others) it's going to be necessary
> to have zle hard-wired, at least until it's possible to restrict
> modules to a pre-defined set of hooks into zle.
> 

Probably, configure has to check, if RTLD_GLOBAL is defined (is it on
IRIX?). Is there a system, which does _not_ need RTLD_GLOBAL to export
symbols between dlopen() calls?

> Anyway, I added comp1 and zle to modules-bltin by hand and everything
> else seems fine with dynamic loading.  This should therefore become
> the default for IRIX, even with --dynamic; I couldn't see code for it
> in configure.in, though.
> 

What would be fine, is the ability to statically link modules in zsh main
distribution, but still retain dynamic modules feature.

greetings

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@sni.de
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Shared libraries on IRIX
  1997-02-10 15:44 ` Andrej Borsenkow
@ 1997-02-10 16:35   ` Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 1997-02-10 16:35 UTC (permalink / raw)
  To: borsenkow.msk; +Cc: pws, zsh-workers

One of the things I've planned to do, but not found the time for, is an
autoconf test to see if the RTLD_GLOBAL functionality is actually
supported.  modules-bltin can then default to containing "comp1 zle"
when it isn't supported (but dynamic loading is enabled).

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-02-10 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-10 10:47 Shared libraries on IRIX Peter Stephenson
1997-02-10 15:44 ` Andrej Borsenkow
1997-02-10 16:35   ` Zefram

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).