RE: useless linking

From: Murray S. Kucherawy <msk_at_cloudmark.com>
Date: Wed, 28 Dec 2011 20:53:25 -0800

> -----Original Message-----
> From: opendkim-dev-bounce_at_lists.opendkim.org [mailto:opendkim-dev-bounce_at_lists.opendkim.org] On Behalf Of Andreas Schulze
> Sent: Tuesday, December 27, 2011 3:08 AM
> To: opendkim-dev_at_lists.opendkim.org
> Subject: useless linking
>
> Hi,
>
> my debian package builder warns me about useless dependencies:
>
> dpkg-shlibdeps: warning: dependency on $library could be avoided if
> $proglist were not uselessly linked against it (they use none of its
> symbols).
>
> libz.so.1
> - usr/sbin/opendkim
> - usr/bin/opendkim-atpszone
> - usr/bin/opendkim-genzone
> - usr/bin/opendkim-testkey
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

I have no idea what's linking against libz. I don't reference any functions in there. Perhaps the openssl stuff does.

> libmysqlclient_r.so.16
> - usr/sbin/opendkim
> - usr/bin/opendkim-atpszone
> - usr/bin/opendkim-genzone
> - usr/bin/opendkim-testkey
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

The opendkim database object handling code (opendkim/opendkim-db.c) includes references to MySQL functions if you compile with MySQL enabled. All of those functions you listed above use that file, so that's what creates the dependency. It's possible, but added complexity, to make that file behave differently for each of the above cases. But if you did --with-mysql already, then you've already forced the dependency, so is this really a problem?

> libnsl.so.1
> - usr/sbin/opendkim
> - usr/bin/opendkim-atpszone
> - usr/bin/opendkim-genzone
> - usr/bin/opendkim-testkey
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

If inet_addr() lives in libnsl, that's where the dependency comes from. It might be imported by libopendkim.

> libcrypt.so.1
> - usr/sbin/opendkim
> - usr/bin/opendkim-atpszone
> - usr/bin/opendkim-genzone
> - usr/bin/opendkim-testkey

I don't reference libcrypt functions anywhere, so that must come from some other library.

> libdl.so.2
> - usr/sbin/opendkim
> - usr/bin/opendkim-atpszone
> - usr/bin/opendkim-genzone
> - usr/bin/opendkim-testkey
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

Same.

> libssl.so.0.9.8
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam
>
> libcrypto.so.0.9.8
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

Those are openssl. These don't need it, but they inherit the dependency from libopendkim.

> libevent-1.4.so.2
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

I don't compile against libevent. That's probably inherited from your libunbound.

> libtre.so.5
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

That's libopendkim again, if you have --with-tre.

> libm.so.6
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

--with-lua creates this dependency, and Lua is one of the data set options, so that's where this gets dragged in.

> libldns.so.1
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

That's unbound again.

> libcrypt.so.1
> - usr/bin/opendkim-importstats
> - usr/bin/opendkim-spam

You listed this one above already, oddly with a shorter list...

-MSK
Received on Thu Dec 29 2011 - 04:53:25 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:33:14 PST