Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: loading dynamic modules in a static shell



On Sun, Jan 18, 2004 at 06:14:42AM -0600, Vincent wrote:
> Is it supposed to be possible to compile a static shell with part of
> the modules built in and to be able to load the remaining modules with
> zmodload?  Having a separate link option for every module in
> config.modules gives me the impression that I should be able to create
> a mixed configuration, with some static and some dynamic, but I have
> not been able to get it to work.  I don't know if there is another way
> I am supposed to do it but If I tried setting some with link=dynamic
> and some with link=static in config.modules it would not work.  It
> only compiled either static or dynamic based on how the ldflags were
> set when it was configured with configure.
> 
> I compiled zsh-4.0.9 configured with
> "configure --enable-ldflags=-static", installed it, then reconfigured
> it as shared, did a "make modules" and installed the dynamic modules.
> However, when I try loading one of the dynamic modules that are not
> statically linked in, such as zftp, it just says
> "zsh: failed to load module: zsh/zftp".
> 
> I have searched the FAQ, mailing lists, and documentation, but have
> not found any information that helps me.
> 
> I built a static shell to install in /bin on FreeBSD but did not want
> it be so big with every module compiled in.

I think it depends upon the capabilities of the platform's dynamic
loader.  Certainly for FreeBSD you won't be able to do this.  This is
because all dynamic loading is disabled when a static binary is used.
For the current release (5.2) the root filesystem has been made dynamic
in order to get this working (for the nsswitch stuff to work correctly).

I'm trying to remember the reasons why this is the case, but I can't
quite recall them.  But if you search the freebsd-current mailing list
archives for "dynamic root", that should provoke some enlightening
discussion.

-Dom



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