Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2002 19:51:16 +0200
From:      Miguel Mendez <flynn@energyhq.homeip.net>
To:        Mike Meyer <mwm-dated-1020187662.12a903@mired.org>
Cc:        Edwin Groothuis <edwin@mavetju.org>, freebsd-hackers@freebsd.org
Subject:   Re: missing libraries, and how to find them.
Message-ID:  <20020425195116.A80026@energyhq.homeip.net>
In-Reply-To: <15560.15502.213147.169455@guru.mired.org>; from mwm-dated-1020187662.12a903@mired.org on Thu, Apr 25, 2002 at 12:27:42PM -0500
References:  <20020425210202.A49377@k7.mavetju.org> <20020425140244.A77165@energyhq.homeip.net> <15560.15502.213147.169455@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 25, 2002 at 12:27:42PM -0500, Mike Meyer wrote:

Hi,

> As I stated just a minute ago, my version of that was committed a
> while ago, and will hopefully be MFC's soon.

Good, I didn't know someone else had already submitted a patch before.

> But your script doesn't do the same thing. It only tells you what
> libraries the libraries your command includes. It doesn't go to the
> third third - or further - levels if required.

Well, not exactly. When you link program a with lib b, and lib b depends
on lib c, ldd a shows both libs, so my script works as it will ldd all
libs:

Let's see:

flynn@kajsa# echo "void foo() { bar(); }" > foo.c
flynn@kajsa# echo "void bar() { baz(); }" > baz.c
flynn@kajsa# echo "void baz() { }" >=20
flynn@kajsa# echo "void bar() { baz(); }" > bar.c
flynn@kajsa# echo "void baz() { }" > baz.c
flynn@kajsa# cc -o libbaz.so -shared baz.c
flynn@kajsa# cc -o libbar.so -L/tmp/foo -lbaz -shared bar.c
flynn@kajsa# cc -o libfoo.so -L/tmp/foo -lbar -shared foo.c
flynn@kajsa# echo "int main() { foo(); }" > main.c
flynn@kajsa# cc -o main main.c -L/tmp/foo -lfoo
flynn@kajsa# ldd main
main:
        libfoo.so =3D> /tmp/foo/libfoo.so (0x28068000)
	libc.so.5 =3D> /usr/lib/libc.so.5 (0x2806a000)
	libbar.so =3D> /tmp/foo/libbar.so (0x2811d000)
	libbaz.so =3D> /tmp/foo/libbaz.so (0x2811f000)
			=09
QED :-)

Cheers,
--=20
        Miguel Mendez - flynn@energyhq.homeip.net
        GPG Public Key :: http://energyhq.homeip.net/files/pubkey.txt
        EnergyHQ :: http://www.energyhq.tk
        FreeBSD - The power to serve!

--k+w/mQv8wyuph6w0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE8yEIUnLctrNyFFPERAtlDAJ4rG6Gqu9TmRDQtPuHX/j4ym6fDuwCfdosr
1+kW5eieqrXgRK6D3k8mGCY=
=1QBe
-----END PGP SIGNATURE-----

--k+w/mQv8wyuph6w0--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020425195116.A80026>