[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anyone know how to compile with profiling when using libtool?
From: |
Kevin Ryde |
Subject: |
Re: Anyone know how to compile with profiling when using libtool? |
Date: |
Sat, 15 Mar 2003 07:29:05 +1000 |
User-agent: |
Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i386-pc-linux-gnu) |
Rob Browning <address@hidden> writes:
>
> Though I can augment CFLAGS so that each .c file is compiled with -g
> -pg, I haven't figured out a way to keep libtool from removing -pg
> from the link line. It seems like libtool is removing -pg (and
> -no-undefined, etc.) from the gcc command line just before issuing the
> link command.
One workaround is to make a script "my-gcc-pg" which just execs gcc
-pg, and use that by configuring with CC=my-gcc-pg. I think libtool
recognises gcc based on preprocessor defines, so the name of the
script hopefully doesn't matter.
To do it directly with libtool you can insinuate -Wc,-pg into the
flags, by overriding LDFLAGS or guile_LDFLAGS or whatever.
> If at all possible, I'd rather not have it second guess me for at
> least some of the options...
Rumour has it the next libtool will leave alone anything it doesn't
recognise.
Incidentally, http://sourceforge.net/projects/fnccheck is quite a nice
profiler, based on gcc -finstrument-functions. It uses the i586 rdtsc
to record function entry and exit, so it's a lot more accurate than
10ms sampling by prof.