From owner-freebsd-amd64@FreeBSD.ORG Mon May 17 22:45:51 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53CCE16A4E7 for ; Mon, 17 May 2004 22:45:49 -0700 (PDT) Received: from plewe.is.tsukuba.ac.jp (plewe.is.tsukuba.ac.jp [130.158.81.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3A9D43D39 for ; Mon, 17 May 2004 22:45:46 -0700 (PDT) (envelope-from till@plewe.is.tsukuba.ac.jp) Received: from plewe.is.tsukuba.ac.jp (localhost [127.0.0.1]) i4I5oVrv075852 for ; Tue, 18 May 2004 14:50:31 +0900 (JST) (envelope-from till@plewe.is.tsukuba.ac.jp) Received: (from till@localhost) by plewe.is.tsukuba.ac.jp (8.12.11/8.12.11/Submit) id i4I5oVJF075851 for freebsd-amd64@freebsd.org; Tue, 18 May 2004 14:50:31 +0900 (JST) (envelope-from till) Date: Tue, 18 May 2004 14:50:31 +0900 From: Till Plewe To: freebsd-amd64@freebsd.org Message-ID: <20040518055031.GA75775%till@score.is.tsukuba.ac.jp> References: <20040518050421.GA75633%till@score.is.tsukuba.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040518050421.GA75633%till@score.is.tsukuba.ac.jp> User-Agent: Mutt/1.5.6i Subject: Re: profiling on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: till@score.is.tsukuba.ac.jp List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 05:45:51 -0000 On Tue, May 18, 2004 at 02:04:21PM +0900, Till Plewe wrote: > > The program "int main(){return 0;}" fails to compile if I use the > option "-pg". The error message I get starts with: > > # gcc -pg -o test test.c > /var/tmp//ccTPXtQI.o: In function `main': > /var/tmp//ccTPXtQI.o(.text+0x5): undefined reference to `mcount' > /usr/lib/libc_p.a(gmon.po): In function `monstartup': > gmon.po(.text+0xa): undefined reference to `mcount > ... > > I am using 5.2-CURRENT cvsuped 3 hours ago. > > It looks like a gcc bug since there are several related bug reports > for other OSs (the once I looked were all for 64bit architectures). > > Does anybody know how to fix this? > > TIA > > - Till > It seems that gprof is not build any longer by default. "/usr/src/usr.bin/gprof" does not contain the files amd64.{c,h} needed to build gprof. Since the files for the other architectures seem to be essentially the same I just used copies of these to build gprof. But since I cannot produce *.gmon files as long as gcc -pg does not work I cannot check if the resulting binary works or not. Are there amd64 specific problems with gprof or is gprof being replaced by some other profiler? - Till