Direct or indirect libdependencies (using the libintl.so.8 case)

Alexander Leidinger Alexander at Leidinger.net
Thu Jun 3 13:02:16 UTC 2010


Quoting Peter Jeremy <peter at vk2pj.dyndns.org> (from Thu, 3 Jun 2010  
22:37:28 +1000):

> On 2010-Jun-01 10:54:02 +0200, Jan Henrik Sylvester <me at janh.de> wrote:
>> Yesterday, I was chasing libintl.so.8, rebuilding all ports that got
>> bumped, checking with libchk for other libintl.so.8 dependencies, and
>> forcing a rebuild of all these packages: All but two of them had an
>> indirect dependency on devel/gettext (and I did email the maintainers of
>> devel/ccrtp and textproc/gsed linking without a dependency).
>
> This might be unrealistic but, IMHO, these "indirect dependencies" should
> not exist.  IMHO, there should only be two situations:
>
> 1) Port X directly links against or dlopen's libY.so from port Y.
>
> In this case, port Y should be listed in LIB_DEPENDS or equivalent
> for port X and port X will need a portrevision bump and rebuild if
> the port Y ABI changes (eg a .so version bump)
>
> 2) Port X directly links against or dlopen's libZ.so and libZ.so pulls
>    in libY.so from port Y.
>
> In this case, port X should not be directly accessing any symbols in
> libY.so.  If the libY.so ABI changes, libZ.so will need to be rebuilt
> but unless the libZ.so ABI changes, there should be no need to rebuild
> port X.
>
> Are there any other situations that have to be considered?

The problem is a little bit more complex if you have a look at the big  
picture.

Indirect dependencies get hardcoded into binaries in several  
cases(*1), except you use a compiler switch which tells the  
compile-time-linker to not record library dependencies when no symbols  
of those libs are reference directly(*2).

If you want to know which libs are linked into binaries of a port, I  
suggest you have a look at my  
/usr/ports/Tools/scripts/explicit_lib_depends.sh script (note that its  
name starts with "explicit", not with "direct", this is on purpose as  
those two descriptions have a different semantic which is important  
for this discussion).

(*1) Either by libtool as it does not has some hint enabled on  
FreeBSD, or by pkg-config listing them directly even if the  
corresponding library does not reference symbols of such a dependency  
in its API.

(*2) This is used by some gnome ports (not all), and can not be  
enabled globally, as some programs may depend upon this (e.g. when  
loading plugins which are not linked correctly).

Bye,
Alexander.

-- 
Most people can do without the essentials, but not without the luxuries.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-ports mailing list