public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] checdeps.rb for getting deps out of elf files
@ 2005-12-23 11:09 Petteri Räty
  2005-12-23 12:47 ` Thomas de Grenier de Latour
  2005-12-23 14:35 ` Mike Frysinger
  0 siblings, 2 replies; 11+ messages in thread
From: Petteri Räty @ 2005-12-23 11:09 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

http://dev.gentoo.org/~betelgeuse/scripts/checkdeps.rb
Some people will probably find this useful. Basically it does ldd on all
the elf files in a package and then checks to which packages those
libraries belong. I think portage people are working on integrating
something like this to portage in the form of verify-rdepend.

Regards,
Petteri

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-23 11:09 [gentoo-dev] checdeps.rb for getting deps out of elf files Petteri Räty
@ 2005-12-23 12:47 ` Thomas de Grenier de Latour
  2005-12-23 14:35 ` Mike Frysinger
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas de Grenier de Latour @ 2005-12-23 12:47 UTC (permalink / raw
  To: gentoo-dev

On Fri, 23 Dec 2005 13:09:08 +0200
Petteri Räty <betelgeuse@gentoo.org> wrote:

> Basically it does ldd on all the elf files in a package and then
> checks to which packages those libraries belong. 

I don't think "ldd" alone is the way to go, because it doesn't make
distinction beetween direct and indirect links, and thus real and
deep deps. 
To give you the idea, there's a patch in this thread for Spider's
"depreverse" script, which shows how to filter "ldd" output to keep
only NEEDED libs (using "objdump" here, although it would be doable
with "scanelf" too nowdays):
http://thread.gmane.org/gmane.linux.gentoo.devel/27288

--
TGL.

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-23 11:09 [gentoo-dev] checdeps.rb for getting deps out of elf files Petteri Räty
  2005-12-23 12:47 ` Thomas de Grenier de Latour
@ 2005-12-23 14:35 ` Mike Frysinger
  2005-12-27 22:12   ` Petteri Räty
  1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2005-12-23 14:35 UTC (permalink / raw
  To: gentoo-dev

On Fri, Dec 23, 2005 at 01:09:08PM +0200, Petteri R??ty wrote:
> Basically it does ldd on all
> the elf files in a package and then checks to which packages those
> libraries belong.

ldd is garbage for this purpose

use `readelf -d ELF | grep NEEDED` or just `scanelf -n ELF`
-mike
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-23 14:35 ` Mike Frysinger
@ 2005-12-27 22:12   ` Petteri Räty
  2005-12-28 16:11     ` Paul de Vrieze
  0 siblings, 1 reply; 11+ messages in thread
From: Petteri Räty @ 2005-12-27 22:12 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

Mike Frysinger wrote:
> On Fri, Dec 23, 2005 at 01:09:08PM +0200, Petteri R??ty wrote:
> 
>>Basically it does ldd on all
>>the elf files in a package and then checks to which packages those
>>libraries belong.
> 
> 
> ldd is garbage for this purpose
> 
> use `readelf -d ELF | grep NEEDED` or just `scanelf -n ELF`
> -mike

Adjusted to using scanelf:

http://dev.gentoo.org/~betelgeuse/scripts/checkdeps.rb

This has the side affect that the library location code is not used
until I code or take the logic from glibc from example.

betelgeuse@pena ~/bin $ checkdeps.rb subversion
dev-libs/apr
dev-libs/apr-util
dev-libs/expat
dev-libs/openssl
dev-util/subversion
net-misc/neon
sys-libs/db || app-office/openoffice-bin
sys-libs/gdbm
sys-libs/glibc
sys-libs/zlib


Old ldd using version:
http://dev.gentoo.org/~betelgeuse/scripts/checkdepsldd.rb

Regards,
Petteri

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-27 22:12   ` Petteri Räty
@ 2005-12-28 16:11     ` Paul de Vrieze
  2005-12-28 16:26       ` Petteri Räty
  2005-12-28 20:13       ` Mike Frysinger
  0 siblings, 2 replies; 11+ messages in thread
From: Paul de Vrieze @ 2005-12-28 16:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]

On Tuesday 27 December 2005 23:12, Petteri Räty wrote:
>
> This has the side affect that the library location code is not used
> until I code or take the logic from glibc from example.
>
> betelgeuse@pena ~/bin $ checkdeps.rb subversion
> dev-libs/apr
> dev-libs/apr-util
> dev-libs/expat
> dev-libs/openssl
> dev-util/subversion
> net-misc/neon
> sys-libs/db || app-office/openoffice-bin
> sys-libs/gdbm
> sys-libs/glibc
> sys-libs/zlib

Unfortunately scanelf also doesn't know (nor can it know) that some libraries 
like apr-util do not link against the libraries they need, but leave it for 
users to link against them properly by means of the apu-config utility. As 
such subversion could link against libldap. It does however not depend on 
libldap, as this comes from apr-util. Perhaps this means that apr-util should 
be fixed, but it certainly does not mean that subversion missed a dep.

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 16:11     ` Paul de Vrieze
@ 2005-12-28 16:26       ` Petteri Räty
  2005-12-28 19:38         ` Paul de Vrieze
  2005-12-28 20:13       ` Mike Frysinger
  1 sibling, 1 reply; 11+ messages in thread
From: Petteri Räty @ 2005-12-28 16:26 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

Paul de Vrieze wrote:
> On Tuesday 27 December 2005 23:12, Petteri Räty wrote:
> 
>>This has the side affect that the library location code is not used
>>until I code or take the logic from glibc from example.
>>
>>betelgeuse@pena ~/bin $ checkdeps.rb subversion
>>dev-libs/apr
>>dev-libs/apr-util
>>dev-libs/expat
>>dev-libs/openssl
>>dev-util/subversion
>>net-misc/neon
>>sys-libs/db || app-office/openoffice-bin
>>sys-libs/gdbm
>>sys-libs/glibc
>>sys-libs/zlib
> 
> 
> Unfortunately scanelf also doesn't know (nor can it know) that some libraries 
> like apr-util do not link against the libraries they need, but leave it for 
> users to link against them properly by means of the apu-config utility. As 
> such subversion could link against libldap. It does however not depend on 
> libldap, as this comes from apr-util. Perhaps this means that apr-util should 
> be fixed, but it certainly does not mean that subversion missed a dep.
> 
> Paul
> 

I just picked some package as an example of the output with
openoffice-bin. My understanding here is that if you link against those
libraries, it will break break binary packages because dependencies
don't say to pull in required libraries. This just means that apr-util
should be fixed.

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 16:26       ` Petteri Räty
@ 2005-12-28 19:38         ` Paul de Vrieze
  2005-12-28 19:52           ` Petteri Räty
  0 siblings, 1 reply; 11+ messages in thread
From: Paul de Vrieze @ 2005-12-28 19:38 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

On Wednesday 28 December 2005 17:26, Petteri Räty wrote:
>
> I just picked some package as an example of the output with
> openoffice-bin. My understanding here is that if you link against those
> libraries, it will break break binary packages because dependencies
> don't say to pull in required libraries. This just means that apr-util
> should be fixed.
>

By the way, you might want to check the locations of libraries. Openoffice-bin 
does not satisfy the dependency for the db library. It namely is outside the 
library search path (and it should be). You might want to use ld.so.conf with 
the rpath attribute of the binary to determine which libraries to consider.

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 19:38         ` Paul de Vrieze
@ 2005-12-28 19:52           ` Petteri Räty
  2005-12-29 17:29             ` solar
  0 siblings, 1 reply; 11+ messages in thread
From: Petteri Räty @ 2005-12-28 19:52 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

Paul de Vrieze wrote:
> On Wednesday 28 December 2005 17:26, Petteri Räty wrote:
> 
>>I just picked some package as an example of the output with
>>openoffice-bin. My understanding here is that if you link against those
>>libraries, it will break break binary packages because dependencies
>>don't say to pull in required libraries. This just means that apr-util
>>should be fixed.
>>
> 
> 
> By the way, you might want to check the locations of libraries. Openoffice-bin 
> does not satisfy the dependency for the db library. It namely is outside the 
> library search path (and it should be). You might want to use ld.so.conf with 
> the rpath attribute of the binary to determine which libraries to consider.
> 

Working on it with solar. I just put the || in there until I have
something better. Thinking about libstdc++-v3 having all the
alternatives is also useful. Developers should know that the one from
openoffice is not used.

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 16:11     ` Paul de Vrieze
  2005-12-28 16:26       ` Petteri Räty
@ 2005-12-28 20:13       ` Mike Frysinger
  2005-12-28 20:43         ` Paul de Vrieze
  1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2005-12-28 20:13 UTC (permalink / raw
  To: gentoo-dev

On Wednesday 28 December 2005 11:11, Paul de Vrieze wrote:
> Unfortunately scanelf also doesn't know (nor can it know)

no utility will be able to passively calculate dependencies that happen via 
dlopen() or any similar dynamic library loading interface
-mike
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 20:13       ` Mike Frysinger
@ 2005-12-28 20:43         ` Paul de Vrieze
  0 siblings, 0 replies; 11+ messages in thread
From: Paul de Vrieze @ 2005-12-28 20:43 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

On Wednesday 28 December 2005 21:13, Mike Frysinger wrote:
> On Wednesday 28 December 2005 11:11, Paul de Vrieze wrote:
> > Unfortunately scanelf also doesn't know (nor can it know)
>
> no utility will be able to passively calculate dependencies that happen via
> dlopen() or any similar dynamic library loading interface

What happens here is not so much dlopen as just not linking it in the proper 
library. I don't know whether to blame libtool or apr-util itself. But it's 
not clean to say the least. It happens more often though.

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] checdeps.rb for getting deps out of elf files
  2005-12-28 19:52           ` Petteri Räty
@ 2005-12-29 17:29             ` solar
  0 siblings, 0 replies; 11+ messages in thread
From: solar @ 2005-12-29 17:29 UTC (permalink / raw
  To: gentoo-dev

On Wed, 2005-12-28 at 21:52 +0200, Petteri Räty wrote:
> Paul de Vrieze wrote:
> > On Wednesday 28 December 2005 17:26, Petteri Räty wrote:
> > 
> >>I just picked some package as an example of the output with
> >>openoffice-bin. My understanding here is that if you link against those
> >>libraries, it will break break binary packages because dependencies
> >>don't say to pull in required libraries. This just means that apr-util
> >>should be fixed.
> >>
> > 
> > 
> > By the way, you might want to check the locations of libraries. Openoffice-bin 
> > does not satisfy the dependency for the db library. It namely is outside the 
> > library search path (and it should be). You might want to use ld.so.conf with 
> > the rpath attribute of the binary to determine which libraries to consider.
> > 
> 
> Working on it with solar. I just put the || in there until I have
> something better. Thinking about libstdc++-v3 having all the
> alternatives is also useful. Developers should know that the one from
> openoffice is not used.

We just added -L to be used with -n in scanelf(pax-utils-0.1.6) to 
search the ld.so.cache. It works in uclibc and glibc environments and 
handles 32/64 bit dupes. We can't verify any of the *BSD's at this time 
however as we no access to one of it's caches. 

-- 
solar <solar@gentoo.org>
Gentoo Linux

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-12-29 17:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-23 11:09 [gentoo-dev] checdeps.rb for getting deps out of elf files Petteri Räty
2005-12-23 12:47 ` Thomas de Grenier de Latour
2005-12-23 14:35 ` Mike Frysinger
2005-12-27 22:12   ` Petteri Räty
2005-12-28 16:11     ` Paul de Vrieze
2005-12-28 16:26       ` Petteri Räty
2005-12-28 19:38         ` Paul de Vrieze
2005-12-28 19:52           ` Petteri Räty
2005-12-29 17:29             ` solar
2005-12-28 20:13       ` Mike Frysinger
2005-12-28 20:43         ` Paul de Vrieze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox