Using -p (or -pg) with gcc-1.39

John Coolidge coolidge at cs.uiuc.edu
Wed Feb 6 11:08:43 AEST 1991


jimg at zeno.gso.uri.edu (James Gallagher) writes:
>I have had no success. 

>Here's what I've tried: 
>1) I tried compiling a simple program with 'gcc -p -v -D_BSD_SOURCE
>-D_SYSV_SOURCE simple.c' and got the error 'linker cant find -lc_p'.

My fault; I left LIB_SPEC doing the wrong thing. Fixed in the next
release :-). I'm not sure what the right thing to do with -pg is; for
now I'll have it do the same thing as -p. Perhaps one day I'll
produce my 'almost complete, almost wonderful, mostly free libc' and
run gprof on it :-)

>2) I tried 'cc -v -p simple.c' (I can use cc on simple.c, but not on the ANSI
>program I want to profile). That works. So, I tried using the linker that way
>cc did (it used /lib/libp/libc rather than the non-existant libc_p). However,
>I got an undefined symbol error (d0 and mcount 'referenced but not defined').

This I'll have to look at. I don't really know anything about the
profiling code or what's needed to make it work. I'll try to figure
things out and make it all work. There's some code in the gcc config
file which is supposed to support profiling, but I'm not sure what
it's doing and why...

>Any help would be grately appreciated.

None of this really helps; I'll take a look at it sometime soon. I'd
kinda like to profile some things myself (although I seem to recall
some depressing posts about the stability of profiling in general
under A/UX; anyone remember something like that?). Right now I'm
finishing off g++ (seems to be stable; found one bug in libg++ and
broke it somewhere else; whole package hopefully later this week :-)).

--John

--------------------------------------------------------------------------
John L. Coolidge     Internet:coolidge at cs.uiuc.edu   UUCP:uiucdcs!coolidge
Of course I don't speak for the U of I (or anyone else except myself)
Copyright 1991 John L. Coolidge. Copying allowed if (and only if) attributed.
You may redistribute this article if and only if your recipients may as well.



More information about the Comp.unix.aux mailing list