[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
thanks
Hello!
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:
#v+
$ 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
#v-
> %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
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5212>.
Regards,
Thomas
signature.asc
Description: Digital signature