bug-libtool
[Top][All Lists]
Advanced

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

Re: -no-undefined (was: libposix)


From: Ralf Wildenhues
Subject: Re: -no-undefined (was: libposix)
Date: Tue, 5 Oct 2010 19:02:03 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Bruno,

* Bruno Haible wrote on Tue, Oct 05, 2010 at 11:46:05AM CEST:
> > > 1)   libposix_la_LDFLAGS += -no-undefined
> > > 
> > >    This should ensure that on all platforms, the linking of libposix.so 
> > > will
> > >    fail if there are undefined references. Without waiting for a program 
> > > to
> > >    be linked with libposix.
> > 
> > That would be nice, but unfortunately that is not the case.
> > Adding -no-undefined is a promise made by the developer that
> > the library does not depend on libraries not listed.
> 
> And the module descriptions of gnulib modules make the promise to the
> developer that the 'Link:' fields are complete. 
> 
> > However, the developer cannot know or guarantee that she links
> > against (installed) libraries which themselves may depend on
> > undefined references.
> 
> If a gnulib module contains a 'Link:' directive that triggers undefined
> references, it is a bug in that gnulib module.

Ah, sorry, we're talking past each other.  I didn't mean to hint at a
gnulib bug here in any way at all.  Rather, even *if* gnulib lists all
required libraries correctly and the developer uses them correctly,
then using the -Wl,-z,defs link flag could cause spurious link failures
on GNU/Linux because of games played with symbol definitions in one of
glibc, GCC, or binutils (I don't remember).  This has prevented libtool
from providing an effective way to fail due to symbols undefined in
shared libraries.

> > This is one reason libtool does not use -Wl,-z,defs on GNU/Linux
> > even with -no-undefined. 
> 
> I don't know what -Wl,-z,defs means.

It causes binutils ld to complain about unresolved symbols.

> I trust the libtool developers to
> implement -no-undefined correctly on all platforms.

Thanks!  :-)

> What I know, is that
> the absence of -no-undefined prevents libtool from creating shared libraries
> on some platforms (I think, Cygwin and AIX, maybe others).

w32 ones, yes.  Because that system cannot cope with unresolved symbols
in a straightforward way.

> Creating shared
> objects with incomplete references (like what may be required for some
> X11 programs that want to use libXaw3d instead of libXaw) is outside the
> scope of gnulib-tool.

Good.

Cheers,
Ralf



reply via email to

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