Mail Archives: djgpp/1996/10/10/22:25:18
vecna wrote:
>
> Alright, I want to profile my game. So, I looked up in the FAQ, how to use
> gprof. It told me I needed to compile and link with the -pg option, then run
> the program through gprof. Fine, I can do that...
>
> So I compile with -pg perfectly, but...when I try to link it with that it
> tells me that -pg is an unknown option! Obviously, gprof did not work.
>
> So... what's the deal? Do I have a terribly outdated version of the linker?
> It's the standard DJGPP v.2.0 distribution. I'm using DOS 6.2, not running
> from windows, using RHIDE. There may be a newer version of rhide, but a ld -h
> confirmed that -pg was not in it's vocabulary. What should I do? Please,
> respond promptly, I'm on a time table.. :( Thanks in advance,
Nay, nay, nay! You have to invoke 'ld' through gcc for the '-pg' option
to work. Profiling is accomplished by means of linking with a special
version of the djgpp startup code, not by anything specific that the
linker does. You can, I suppose, study the linker scripts in
'lib/specs', or study the output of 'gcc -v -pg ...' to see how the
linker pass can be invoked manually, but it's far easier to invoke gcc
itself for the link stage.
For example:
% gcc -g -O -Wall -pg -c *.c
% gcc -pg -o main.exe *.o
Or something like that. Unless you are doing something _really_ wierd,
there should never be any need to manually call the linker.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Plan: To find ANYONE willing to | http://www.cs.com/fighteer |
| play Descent 2 on DWANGO! | Tagline: <this space for rent> |
---------------------------------------------------------------------
- Raw text -