[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC Spec File for Profiling

From: Michael Casadevall
Subject: GCC Spec File for Profiling
Date: Sat, 14 Jul 2007 10:49:13 -0400 (EDT)

After some trail and error as well as reading up how static binaries work and the difference between gcrt0 and gcrt1, I was able to fix the profiling bug with a GCC spec file:

%rename startfile old_startfile

*startfile: %{!shared: %{!static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} 
%{!p:crt1.o%s}}} %{static: %{pg:gcrt0.o%s} %{!pg:{%p:gcrt0}} %{!p:crt0.o%s}}} 
crti.o%s %{static:crtbeginT.o%s} %{!static:%{!shared:crtbegin.o%s} 

For those of you who know how Hurd handles statically linked binaries, you'll probably find it weird that we only link against gcrt0. The reason behind that is that the profiling code in GCC only works against static binaries; it doesn't support shared binaries. This is my first time ever messing around with GCC (or writing a spec file) so I'd be intersted in hearing some feedback. I already figured out howto change GCCs internal specs file to include this change, but I wanted to hear from the experts before I submit a patch.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]