[Top][All Lists]

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

shared libs depending on static libs on x86

From: Jason Kraftcheck
Subject: shared libs depending on static libs on x86
Date: Thu, 09 Mar 2006 14:08:22 -0600
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

I've a couple questions about the behavior of libtool that I'm hoping someone
will answer for me.  I'm using libtool 1.5.22 on Linux/x86.

1) I have a situation as follows:  I am building both static and shared versions
of a library.  This library depends on a third-party library, which may be
either static or shared.  If the third-party library is shared, everything seems
to work as expected.  If the third-party library is static, things work as I
would expect when creating my static library: the third-party library is listed
as a dependency in the .la file.  However, when creating my shared library with
a static third-party library, the behavior is rather confusing.  Rather than
just noting the third-party library as a dependency, libtool includes the text
of the library in my dynamic library.

Including the text of a static archive in my dynamic library makes the library
no longer an (entirely) shared object, as it has a big chunk of non-PIC text.
Also, this results in an unpleasant situation because the applications
ultimately using my shared library typically also depend on other libraries that
are dependent on the same third-party library.

I understand that on some platforms (AIX?), dynamic libraries cannot have
unresolved dependencies, making it necessary to include the static archive text
in a dynamic library on those platforms.  However, it seems like the wrong thing
to do when it can be avoided.  Why does libtool default to doing this on x86 and
x86_64?  Is there some easy way I can work around this without breaking the
build on platforms that do not allow unresolved symbols in dynamic libraries?

2) I have a automake convenience library that is to be linked into my final
library.  libtool generates both PIC and non-PIC versions of the objects
contained in the convenience library.  It only uses the shared objects when
creating the archive (.a) for the convenience library.  It then uses the objects
from the .a for the convenience library when creating both the static and shared
versions of my final library.  Why aren't the non-PIC convenience objects used
for the static version of the final library?  Did I miss something?


- jason kraftcheck

reply via email to

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