[avahi] [PATCH] use Libs.private to avoid DT_NEEDED pollution when building shared

Lennart Poettering lennart at poettering.de
Thu Nov 24 09:41:14 PST 2005

On Thu, 24.11.05 15:07, Nix (nix at esperi.org.uk) wrote:

> The library:
> - libavahi-client.so
>    - libavahi-common.so
> Some user, which uses functions from -client's exposed interface only:
> - some-user
>   - libavahi-common.so   <---
>   - libavahi-client.so
>      - libavahi-common.so
> Note that unnecessary extra dependency.

Unnecessary? I don't see anything unnecessary.

> The problem here is that if libavahi-common breaks its ABI and bumps its
> soname, but libavahi-common does not (fairly likely as libavahi-common
> is entirely an internal library that is not exposed, as I understand
> it), as it is, *every user of libavahi-client.so will need to
> relink*,

This is a misconception. User applications do make use of
avahi-common. Stuff like error handling, event loop abstraction,
domain name handling utilities or data structures for managing TXT
records are part of avahi-common, not of avahi-client. I guess you'll
have a hard time to find an application that makes use of avahi-client
but doesn't use any of the stuff mentioned above.

avahi-common contains all functions that are needed both by
applications that link against avahi-core and apps that link against

The "Avahi Client API (tm)" is avahi-client + avahi-common.

The "Avahi Embeddable Stack API (tm)" is avahi-core + avahi-common.

> even though no interfaces in libavahi-client.so have changed and its
> soname remains unchanged.
> This has a very severe impact with widely-used libraries, with major
> distros going so far as to entirely disable pkg-config dependency
> chasing because the pollution was getting so extreme. (For instance,
> virtually everything in GNOME has a DT_NEEDED dependency on libdb-*.so,
> even though hardly anything uses it, leading to massive unnecessary
> pain whenever libdb bumps its soname.)

I removed the avahi-common deps from the avahi-qt3, avahi-qt4 and
avahi-glib pkg-config files now. I sincerely doubt that there are
programs that make use of any of those three libs without linking
against avahi-common, but I must admit that - strictly speaking -
avahi-common is not a dependency of the avahi-{qt3,qt4,glib} APIs.

> Thankfully, after much screaming from the distributors pkg-config
> grew a new field, Libs.private: things in this field get exposed on the
> link line *only* when linking statically. (It requires pkg-config 0.18,
> but so do recent versions of GNOME and KDE, so this is unlikely to be
> much of a problem...)
> This makes avahi use it. (Massive patch-bombing coming soon as I try to
> make GNOME and KDE use it, too).

Since this patch seems to be based on the misconception of yours
mentioned above, I guess it is pointless now?


Lennart Poettering; lennart [at] poettering [dot] de
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.de/lennart/

More information about the avahi mailing list