+2008-06-21 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/dpkg-shlibdeps.pl: If the binary analyzed is a library on a
+ non-public path, assume it's likely a plugin and reduce the number of
+ warnings displayed about symbols not found. Also use a different,
+ hopefully less confusing message.
+ * man/dpkg-shlibdeps.1: Document the above changes.
+
2008-06-21 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Vendor.pm: Provide simple parser for vendor-specific
change behaviour dynamically depending on the vendor of the current system
(or target system when the user overrides DEB_VENDOR by setting it himself).
Closes: #457371
+ * dpkg-shlibdeps give less strong warnings for symbols not found in NEEDED
+ libraries when the shared library is a non-public directory and is likely
+ to be a plugin. Closes: #481165
[ Pierre Habouzit ]
* Add a --query option to update-alternatives. Closes: #336091, #441904
with an additional library during the build process (option \fB-l\fR\fIlibrary\fR
of the linker).
.TP
+.IB binary " contains an unresolvable reference to symbol " sym ": it's probably a plugin
+The indicated symbol has not been found in the libraries linked with the
+binary. The \fIbinary\fR is most likely a plugin and the symbol is
+probably provided by the program that loads this plugin. In theory a
+plugin doesn't have any SONAME but this binary does have one and as such
+it could not be clearly identified as such. However the fact that the
+binary is stored in a non-public directory is a strong indication
+that's it's not a normal shared library. If the binary is really a
+plugin, then disregard this warning. But there's always the possibility
+that it's a real library and that programs linking to it are using an
+RPATH so that the dynamic loader finds it. In that case, the library is
+broken and needs to be fixed.
+.TP
.BI "dependency on " library " could be avoided if " binaries " were not uselessly linked against it (they use none of its symbols)."
None of the \fIbinaries\fP that are linked with \fPlibrary\fP use any of the
symbols provided by the library. By fixing all the binaries, you would avoid
use English;
use POSIX qw(:errno_h :signal_h);
use Cwd qw(realpath);
+use File::Basename qw(dirname);
+
use Dpkg;
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(warning error failure syserr usageerr);
use Dpkg::Path qw(relative_to_pkg_root guess_pkg_root_dir
check_files_are_the_same);
use Dpkg::Version qw(compare_versions);
-use Dpkg::Shlibs qw(find_library);
+use Dpkg::Shlibs qw(find_library @librarypaths);
use Dpkg::Shlibs::Objdump;
use Dpkg::Shlibs::SymbolFile;
use Dpkg::Arch qw(get_host_arch);
use Dpkg::Deps;
use Dpkg::Control;
+
use constant {
WARN_SYM_NOT_FOUND => 1,
WARN_DEP_AVOIDABLE => 2,
# Disable warnings about missing symbols when we have not been able to
# find all libs
my $disable_warnings = scalar(keys(%soname_notfound));
+ my $parent_dir = "/" . dirname(relative_to_pkg_root($file));
+ my $in_public_dir = (grep { $parent_dir eq $_ } @librarypaths) ? 1 : 0;
foreach my $sym ($obj->get_undefined_dynamic_symbols()) {
my $name = $sym->{name};
if ($sym->{version}) {
# Drop the default suffix for readability
$print_name =~ s/\@Base$//;
unless ($sym->{weak}) {
- if ($debug or $nb_warnings < 10) {
- warning(_g("symbol %s used by %s found in none of the " .
- "libraries."), $print_name, $file);
+ if ($debug or ($in_public_dir and $nb_warnings < 10)
+ or (!$in_public_dir and $nb_warnings < 1))
+ {
+ if ($in_public_dir) {
+ warning(_g("symbol %s used by %s found in none of the " .
+ "libraries."), $print_name, $file);
+ } else {
+ warning(_g("%s contains an unresolvable reference to " .
+ "symbol %s: it's probably a plugin."),
+ $file, $print_name);
+ }
$nb_warnings++;
} else {
$nb_skipped_warnings++;