[Top][All Lists]

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

Re: building a shared library that depends on a static library

From: Jason Kraftcheck
Subject: Re: building a shared library that depends on a static library
Date: Fri, 03 Mar 2006 10:45:23 -0600
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Ralf Wildenhues wrote:
> Hi Jason,
> * Jason Kraftcheck wrote on Tue, Feb 28, 2006 at 02:42:34AM CET:
>>Automake includes the contents of the $LIBS variable in all link commands,
>>including linking libraries.  This results in the following behavior:
>>3) If libtool is creating a shared library, and one or more of the libraries 
>>$LIBS is static, behavior is *incorrect*.  libtool links the objects in the
>>static archives into the resulting shared library.  As static archives are
>>typically compiled w/out PIC, the result is a broken shared library.
> Which system is this on?   GNU/Linux x86_64?

i686-pc-linux-gnu (Debian Etch w/ libtool 1.5.22)

But this was problem in our build was pointed out to me by someone w/ Redhat on
an x86_64 box, where the linker complained about the non-PIC objects in the
shared library.  On x86, I got no warning about this.  I had to use nm to verify
that it was also occurring on my x86 box.

> $ grep "^deplibs_check_method" ./libtool
> is pass_all, right?


$ grep "^deplibs_check_method" ./libtool

>>How do I keep the behavior in 1) and 2), while changing the behavior for 3) 
>>that the static libraries in $LIBS are listed as dependencies in the .la file,
>>but not linked into the shared library?
> By fighting a long and hard fight on one of the Libtool lists to kill
> pass_all on your system: it's wrong there.  I'm on your side, BTW.  ;-)
> (And there is a TODO item for this, too.)
> It was changed to pass_all because of times the previous setting did the
> wrong thing for many people, or so I think (was before my time).

Thanks for the info.  Is there some way I can force configure to change the
deplibs_check_method?  Even if I have to change it for all platforms, that would
be OK.  It would cause us far fewer problems to just not build shared libraries
on the platforms where this option is required.  I'd much rather have no shared
libraries on more obscure platforms than broken shared libraries on the more
common ones.

- jason

reply via email to

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