Subject: Re: lib/653: cc -p file.c causes load error
To: Phil Nelson <phil@steelhead.cs.wwu.edu>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: netbsd-bugs
Date: 12/22/1994 01:33:53
> >Description:
> 	Compiling with the "profile" option causes a ld error
> 	"mcrt0.o: No such file or directory"
> 	
> >How-To-Repeat:
> 	echo "main(){}" > file.c
> 	cc -p file.c
> >Fix:
> 	One of:
> 		have src/lib/csu/XXX install gcrt0.o with a link
> 		to mcrt0.o
> 	or
> 		change cc to use gcrt0.o insted of mcrt0.o

These solutions are not correct.  you'll note, in the gcc man page:

       -p     Generate  extra  code  to write profile information
              suitable for the analysis program prof.

       -pg    Generate extra code to  write  profile  information
              suitable for the analysis program gprof.

since we don't _have_ 'prof' to use on binaries, you shouldn't be
using -p.

The correct solution to your problem is to use "-pg".  8-)



chris