On Fri, Dec 28, 2001 at 07:53:31PM +0100, Marcus Brinkmann wrote: > >Description: > I fixed the Hurd specs file to support profiling (which was broken > for statically linked programs). The specs file I successfully used > is attached, an analysis of what it does (or should do) is in the > table below. The only relevant part of the specs file (the only > parts which I changed) are "cc1" and "startfile". > > The Hurd has the i386-gnu architecture. > > To profile the program only: > $ gcc -o main main.c -pg > $ ./main > $ gprof main gmon.out > > To profile the program and the C library: > $ gcc -o main main.c -profile > $ ./main > $ gprof main gmon.out > > The specs file implement the following option combinations: > Notes: -shared overrides (and prevents) profiling options at the linking > stage > -profile forces to link the profiling C library statically > -pg/-p does link to the normal C library (dynamically or statically) > > The cc1 option -p is added for all of -p/-pg/-profile (for the first > two automatically, for the third there is a rule in the specs file).
This is inconsistent with the behavior of (the undocumented) -profile on Linux, IIRC; there it links in -lc_p but does not imply -pg. Of course, perhaps that should just be fixed too :) This option really should be added to the documentation. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer