libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking modules into programs problem


From: Nick Hudson
Subject: Re: linking modules into programs problem
Date: Wed, 28 Mar 2001 17:13:27 +0100

Michael Matz wrote:
> 
> Hi,
> 
> On Fri, 23 Mar 2001, Nick Hudson wrote:
> > > If you want something that can be both dlopened and linked with, use
> > > -export-dynamic, not -module.  The downside is that you won't be able
> 
> This might be an option for us...  Then I'll need to look up the list of
> modules which really get linked into other things, and see if it still
> works on other platforms.
> 
> > > I'm not sure need_lib_prefix is really supposed to address this
> > > particular issue.  My recollection is that is was introduced just
> > > because there might be dynamic loaders that would fail to load
> > > libraries whose names didn't start with lib.
> 
> So the semantic of that option would be to create all .so files with a
> lib-prefix.  This helps those dynamic loaders.  But it should also help
> linkers.  That might not have been the intention, but if it hasn't other
> issues, it makes no difference if it was intented or not.

Surely the point is that dynamic loading = module and linking = library.
That's what everyone understands. Some platforms make this a hard
distinction, e.g. Darwin; some a vague distinction, ie. that you can
dynamically load a library but you can't link a module, e.g.
NetBSD/a.out; and others have no distinction, e.g. ELF platforms.
Its libtool's job to work with all of them. At the moment libtool is
closer to the middle ground than any other position. Getting to the ELF
ground means more code in libtool to support Darwin.

> > I'm not going to set need_lib_prefix to yes because IMO that's not the
> > right way to go as it will break more than it fixes.
> 
> Hmm, what exactly is your problem with need_lib_prefix?  It sounds, as if
> your current problem (without that), is, that libtool is feeding a -lbla
> argument to ld, if you try to link in bla.la, but ld is refusing to find
> it (which is correct).  Now, if need_lib_prefix forces the .so file to
> have a lib prefix, and has no other effects (which you failed to show, at
> least I can't find them), making ld find libbla.so, although the .la still
> is called bla.la, what is it precisely, that you don't like about it?

My main problem with changing need_lib_prefix is that its counter
intuitive to the user and actually breaks some pkgs in NetBSD pkgsrc
that have made the assumption that building a with -o name.la -module
results in an object of the form name.so.

People use libtool to create libraries and modules for them because they
want to avoid the compiler/linker option unpleasantness, but then they
ignore libltdl.

> > > But I wouldn't mind having need_lib_prefix set such that one could
> > > link modules into programs/libraries.
> >
> > No offense, but I'm not going to hold my breath for this to be
> > implemented.
> 
> Hmm, it already seems implemented, or I'm missing something crucial in
> your posts.

I was thinking of the case above where to cater for Darwin both a
library and a module would have to be created regardless of the libtool
options.

Nick
-- 
aka address@hidden, address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]