[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc and profiling
Hmm, I just got a friend to compile it on FreeBSD with -pg and it worked
fine. As I say I don't know enough about gcc itself to be of much help
here, and I have no idea why it works there and not on OpenBSD.
I tried playing with the collect2 args (after using gcc -v), and it fails as
soon as you switch to using gcrt0.o.
Just file it as a bug report I guess.. ? Not a huge problem, but it is an
anomaly.
I guess another point to mention was that we tried compiling glib with
profiling support and linking it in on fbsd, but it failed to generate
anything useful (can't remember error now, but something that connated
that it had too many things to keep track of). I am guessing the same
thing would occur on obsd if I tried.
Ian
On Sun, Dec 05, 1999 at 02:58:50PM +0100, Marc Espie wrote:
> The interfacing of gcc with external programs, such as ld, is one of the
> scarier parts of gcc itself.
>
> There are some knobs to automate some *limited* amount of profiling support,
> specifically, -pg automatically links against libc_p instead of libc.
>
> Other libraries do not follow suit. This appears to be intentional: -lm says
> `link against libm.a'. If it automatically became libm_p.a, there would
> be no easy way left to link against some profiled libraries and some
> non-profiled libraries...
>
> The design guideline is that libraries you explicitly have to mention on
> the command line you need to care about, gcc will handle its `default'
> libraries (-lc, -lgcc...) automatically.
>
> There is a huge nasty problem with g++ and libstdc++ currently: there is
> no mechanism in gcc akin to the libc magic handling, that would change the
> name of the standard C++ when profiling is used. (Fortran has a similar
> problem). The solution does involve rewriting a fairly large part of the
> specs handling code... which is already special-cased all over the place,
> and I don't have the time to do it right now.
>
> (for those of you who build the egcs-snapshot port, this is the cause of
> failure of all tests involving C++ and profiling).
> --
> Marc Espie
> |anime, sf, juggling, unicycle, acrobatics, comics...
> |AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
> | `real programmers don't die, they just get out of beta'