Mail Archives: djgpp-workers/2001/11/18/14:42:32
Hello.
How do you build a profiled verison of libc?
Using a copy of CVS sources I added '-a' and '-pg' to the list of options
to src/gcc.opt. I then rebuilt the library. I tried to build a profiled
version of src/libc/posix/sys/stat/stat.c using the following
command-line:
gcc -Wall -g -DTEST -a -pg -I/develop/djgpp.rw/include \
-L/develop/djgpp.rw/lib -o stat stat.c
/develop/djgpp.rw is the root of the CVS tree. Unfortunately this resulted
in a bad executable. I got an illegal instruction exception every time I
tried to run 'stat'.
I then tried with only '-pg' added to gcc.opt, but I had the same
problems.
I could not get a profiled library to work with gcc 2.95.3 or gcc 3.0.2,
both coupled with binutils 2.11.2.
Before I tried adding profiling to the whole library, I compiled relevant
files individually, e.g. xstat.c:
gcc `cat /develop/djgpp.rw/src/gcc.opt` -pg -c xstat.c
Compiling and linking individually profiled objects worked, but it didn't
produce any helpful profiling data (i.e. time spent in the stat functions
was shown as 0). I also tried this with gccs 2.95.3 & 3.0.2.
I'm running Windows 98 SE.
Am I doing something wrong? I believe I've read the relevant sections in
the gprof manual.
Thanks, bye, Rich =]
--
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/
- Raw text -