[Top][All Lists]

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

Re: GCC Spec File for Profiling

From: Thomas Schwinge
Subject: Re: GCC Spec File for Profiling
Date: Sun, 29 Jul 2007 17:24:34 +0200
User-agent: Mutt/1.5.11

reopen 433539


On Sat, Jul 14, 2007 at 10:49:13AM -0400, Michael Casadevall wrote:
> 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:

Are you sure you did check static compiling?

Your patch is now the the Debian gcc-4.1 package and it fails like this
for me when I try to build static executables:

$ gcc -static -x c /dev/null
gcc: spec failure: unrecognized spec option 'p'
/usr/bin/ld: {:gcrt0}: No such file: No such file or directory
collect2: ld returned 1 exit status

> %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}} 

                              Here is a typo, I suppose: ^

> %{!p:crt0.o%s}}} crti.o%s %{static:crtbeginT.o%s} 
> %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.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.

I also didn't look it up so far and without doing so don't know offhand
which of the crt files are to be used under which circumstances.  I can
only tell you that previous discussions about this took place on


Attachment: signature.asc
Description: Digital signature

reply via email to

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