From: Raphael Hertzog Date: Sun, 3 Feb 2008 17:54:00 +0000 (+0100) Subject: dpkg-shlibdeps: some accuracy improvements for warnings about unused libraries X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25546527aadecccb860d9b8cce51732f270bcbeb;p=dpkg dpkg-shlibdeps: some accuracy improvements for warnings about unused libraries * scripts/dpkg-shlibdeps.pl: Handle better the case when the library found has a different soname than the one used to look up the library file. Properly affect symbols coming from it to the soname wanted by the binary, thus avoiding invalid warnings about unused library. --- diff --git a/ChangeLog b/ChangeLog index 3b0d1c7a..25f86503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-03 Raphael Hertzog + + * scripts/dpkg-shlibdeps.pl: Handle better the case when the + library found has a different soname than the one used to look up + the library file. Properly affect symbols coming from it to the + soname wanted by the binary, thus avoiding invalid warnings about + unused library. + 2008-01-31 Raphael Hertzog * scripts/dpkg-genchanges.pl: Always list all binary packages in diff --git a/debian/changelog b/debian/changelog index 6d44911c..ae313fb6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,8 @@ dpkg (1.14.17) UNRELEASED; urgency=low files. It's nice for reviewers and mentors.debian.net was using this field on source only uploads to display short description of what the package is about. + * Handle the case when the library has a different SONAME than the one used + to find it. Closes: #462413 [ Frank Lichtenheld ] * Add a warning in dpkg-buildpackage if the build-dependencies are not diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 3d68585c..e60ed7f5 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -125,6 +125,7 @@ foreach my $file (keys %exec) { my %libfiles; my %altlibfiles; my %soname_notfound; + my %alt_soname; foreach my $soname (@sonames) { my $lib = my_find_library($soname, $obj->{RPATH}, $obj->{format}, $file); unless (defined $lib) { @@ -194,6 +195,10 @@ foreach my $file (keys %exec) { } else { # No symbol file found, fall back to standard shlibs my $id = $dumplibs_wo_symfile->parse($lib); + if ($id ne $soname) { + warning(_g("%s has an unexpected SONAME (%s)"), $lib, $id); + $alt_soname{$id} = $soname; + } push @soname_wo_symfile, $soname; my $libobj = $dumplibs_wo_symfile->get_object($id); # Only try to generate a dependency for libraries with a SONAME @@ -262,6 +267,10 @@ foreach my $file (keys %exec) { } } } else { + if (exists $alt_soname{$syminfo->{soname}}) { + # Also count usage on alternate soname + $used_sonames{$alt_soname{$syminfo->{soname}}}++; + } $used_sonames{$syminfo->{soname}}++; } }