delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/11/18/14:42:32

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3BF80E3C.3081575F@phekda.freeserve.co.uk>
Date: Sun, 18 Nov 2001 19:38:36 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Building a profiled version of libc
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019