profiling on amd64

Till Plewe till at score.is.tsukuba.ac.jp
Mon May 17 22:45:51 PDT 2004


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


More information about the freebsd-amd64 mailing list