Date: Mon, 28 May 2007 18:53:18 -0400 From: Alexander Kabaev <kabaev@gmail.com> To: Giorgos Keramidas <keramida@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: ldd broken for profiling binaries? Message-ID: <20070528185318.1154742e@kan.dnsalias.net> In-Reply-To: <20070528181856.GA81757@kobe.laptop> References: <20070528181856.GA81757@kobe.laptop>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig__j27mJv7PDKZuGYtVBvNu0N
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
On Mon, 28 May 2007 21:18:57 +0300
Giorgos Keramidas <keramida@freebsd.org> wrote:
> ldd seems to be broken for profiling binaries, and the profiling
> binaries built with gcc42 seem to be unusable here:
>=20
> ,-----------------------------------------------------------------------
> | $ cat -n foo.c
> | 1 #include <stdio.h>
> | 2 =20
> | 3 int
> | 4 main(void)
> | 5 {
> | 6 int k;
> | 7 =20
> | 8 for (k =3D 0; k < 10000; k++)
> | 9 printf("Hello world\n");
> | 10 return 0;
> | 11 }
> | $ DEBUG_FLAGS=3D'-pg' ; CFLAGS=3D'' ; export DEBUG_FLAGS CFLAGS
> | $ make cleandir
> | rm -f foo foo.o
> | rm -f .depend GPATH GRTAGS GSYMS GTAGS
> | $ make cleandir
> | rm -f foo foo.o
> | rm -f .depend GPATH GRTAGS GSYMS GTAGS
> | $ make
> | Warning: Object directory not changed from original /tmp/foo
> | cc -pg -c foo.c
> | cc -pg -o foo foo.o
> | $ ./foo
> | /libexec/ld-elf.so.1: ./foo: Unexpected inconsistency: dependency
> libgcc_s.so.1 not found | $ ldd foo
> | foo:
> | /libexec/ld-elf.so.1: foo: Unexpected inconsistency: dependency
> libgcc_s.so.1 not found | foo: exit status 1
> | $
> `-----------------------------------------------------------------------
>=20
linker pulled in libgcc_s.so.1 symbols, but somehow managed not to
record dependency on lib. This might be a bug in binutils, but someone
needs to look close to be sure.
I think I'll disable shared libgcc for profiled builds for now.
--=20
Alexander Kabaev
--Sig__j27mJv7PDKZuGYtVBvNu0N
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
iD8DBQFGW11eQ6z1jMm+XZYRApjqAKCKgt1Wbjv6VtZzeUk1Ir9jALui5QCfSQlV
G0RXVTILl9YVDJyKBqv/iCQ=
=B4mv
-----END PGP SIGNATURE-----
--Sig__j27mJv7PDKZuGYtVBvNu0N--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070528185318.1154742e>
