From owner-freebsd-current@FreeBSD.ORG Thu May 31 00:29:08 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE20F16A46D for ; Thu, 31 May 2007 00:29:08 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF8013C448 for ; Thu, 31 May 2007 00:29:07 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup143.ach.sch.gr [81.186.70.143]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l4V0Rf19026596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 31 May 2007 03:28:16 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l4V0RNPo004034; Thu, 31 May 2007 03:27:32 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l4V0RNmf004033; Thu, 31 May 2007 03:27:23 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 31 May 2007 03:27:23 +0300 From: Giorgos Keramidas To: Alexander Kabaev Message-ID: <20070531002722.GA3985@kobe.laptop> References: <20070528181856.GA81757@kobe.laptop> <20070528185318.1154742e@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070528185318.1154742e@kan.dnsalias.net> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.699, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.50, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-current@freebsd.org Subject: Re: ldd broken for profiling binaries? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2007 00:29:08 -0000 On 2007-05-28 18:53, Alexander Kabaev wrote: > On Mon, 28 May 2007 21:18:57 +0300 > Giorgos Keramidas wrote: > > ldd seems to be broken for profiling binaries, and the profiling > > binaries built with gcc42 seem to be unusable here: > > [...] > > | 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 > > | $ > > `----------------------------------------------------------------------- > > 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. Thanks. It seems to work for now :) $ file foo foo: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, not stripped $ gprof foo foo.gmon [...] called/total parents index %time self descendents called+self name index called/total children 0.06 9.68 1/1 _start [2] [1] 100.0 0.06 9.68 1 main [1] 0.00 8.80 1000000/1000000 bar [8] 0.00 0.88 100000/100000 foo [9] :-)