bug-hurd
[Top][All Lists]
Advanced

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

[address@hidden: Re: gcc 3.3.x and profile]


From: Alfred M. Szmidt
Subject: [address@hidden: Re: gcc 3.3.x and profile]
Date: Fri, 19 Sep 2003 11:03:08 +0200 (MEST)

Could someone comment on this or point me to some place that could?

------- Start of forwarded message -------
Date: Fri, 22 Aug 2003 10:57:53 +0200 (MEST)
From: "Alfred M. Szmidt" <ams@kemisten.nu>
To: ams@kemisten.nu
CC: bug-hurd@gnu.org
Subject: Re: gcc 3.3.x and profile

Hacking on getting profiling going has stalled since I can't really
figure out how to solve a peculiar problem.  Maybe someone here can
come up with a solution.


The problem is as follows, `-pg' does not work, but `-static -pg' does
(it does not work in the sense that it produces an incomplete gmon.out
file, the compiled binary runs just fine).

Now, I don't know if maybe the gcrt1.o file is screwed up (which gets
pulled in with crtbegin.o when compiling with -pg), if my setup is
faulty somehow or if all the magic smoke has run out...

Anyway, these files get pulled in with their respective options (in
both cases crti.o, crtn.o and crtend.o get pulled in as well):

 -pg            gcrt1.o crtbegin.o
 -pg -static    gcrt0.o crtbeginT.o

I have attached the output of gcc (with the --verbose option) when
compiling a "GNU world" program.  The interesting bit of the
specs file is the following (also known as the "startfile" rule):

 %{!shared: 
   %{profile:gcrt0.o%s} 
   %{!static: 
     %{!profile: 
       %{pg:gcrt1.o%s} 
       %{!pg:crt1.o%s}}} 
   %{static: 
     %{!profile: 
       %{pg:gcrt0.o%s} 
       %{!pg:crt0.o%s}}}} 
 crti.o%s 
 %{static:crtbeginT.o%s} 
 %{!static: 
   %{!shared:crtbegin.o%s} 
   %{shared:crtbeginS.o%s}} 

Note: I have removed the -p rule for the time being since it does the
exact same thing as -pg, and it only adds clutter to the existing
rules.  (End of Note)

If more info is needed, just ask and I'll supply it.

Cheerio!

===File ~/gcc/test/hello-pg-static.log======================
Reading specs from /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/specs
Reading specs from //tmp/gcc/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/specs
Configured with: /home/ams/src/gcc/configure --prefix= --enable-languages=c : 
(reconfigured) 
Thread model: single
gcc version 3.3.2 20030820 (prerelease)
 /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/cc1 -quiet -v -iprefix 
/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/ -D__GNUC__=3 
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 hello.c -quiet -dumpbase hello.c 
-auxbase hello -ggdb -Wall -version -p -o /tmp/ccAZEpwh.s
GNU C version 3.3.2 20030820 (prerelease) (i386-unknown-gnu0.3)
        compiled by GNU C version 3.2.
GGC heuristics: --param ggc-min-expand=56 --param ggc-min-heapsize=49144
ignoring nonexistent directory "/tmp/gcc/i386-unknown-gnu0.3/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/include"
ignoring nonexistent directory "/i386-unknown-gnu0.3/include"
ignoring duplicate directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /tmp/gcc/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/include
 /include
End of search list.
 /lib/gcc-lib/i386-unknown-gnu0.3/../../../i386-unknown-gnu0.3/bin/as -V -Qy -o 
/tmp/ccr5Zorr.o /tmp/ccAZEpwh.s
GNU assembler version 2.14 (i386-unknown-gnu0.3) using BFD version 2.14 20030612
 /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/collect2 -m elf_i386 
-static -o hello-pg-static /lib/gcc-lib/i386-unknown-gnu0.3/../../gcrt0.o 
/lib/gcc-lib/i386-unknown-gnu0.3/../../crti.o 
/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/crtbeginT.o 
-L/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2 
-L/tmp/gcc/bin/../lib/gcc-lib 
-L/lib/gcc-lib/i386-unknown-gnu0.3/../../../i386-unknown-gnu0.3/lib 
-L/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/../../.. 
-L/lib/gcc-lib/i386-unknown-gnu0.3/../.. /tmp/ccr5Zorr.o -lgcc -lgcc_eh -lc 
-lgcc -lgcc_eh /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/crtend.o 
/lib/gcc-lib/i386-unknown-gnu0.3/../../crtn.o
============================================================

===File ~/gcc/test/hello-pg.log=============================
Reading specs from /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/specs
Reading specs from //tmp/gcc/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/specs
Configured with: /home/ams/src/gcc/configure --prefix= --enable-languages=c : 
(reconfigured) 
Thread model: single
gcc version 3.3.2 20030820 (prerelease)
 /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/cc1 -quiet -v -iprefix 
/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/ -D__GNUC__=3 
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 hello.c -quiet -dumpbase hello.c 
-auxbase hello -ggdb -Wall -version -p -o /tmp/ccRP4qqA.s
GNU C version 3.3.2 20030820 (prerelease) (i386-unknown-gnu0.3)
        compiled by GNU C version 3.2.
GGC heuristics: --param ggc-min-expand=56 --param ggc-min-heapsize=49144
ignoring nonexistent directory "/tmp/gcc/i386-unknown-gnu0.3/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/include"
ignoring nonexistent directory "/i386-unknown-gnu0.3/include"
ignoring duplicate directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /tmp/gcc/lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/include
 /include
End of search list.
 /lib/gcc-lib/i386-unknown-gnu0.3/../../../i386-unknown-gnu0.3/bin/as -V -Qy -o 
/tmp/cc8dp0ef.o /tmp/ccRP4qqA.s
GNU assembler version 2.14 (i386-unknown-gnu0.3) using BFD version 2.14 20030612
 /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/collect2 --eh-frame-hdr 
-m elf_i386 -dynamic-linker /lib/ld.so -o hello-pg 
/lib/gcc-lib/i386-unknown-gnu0.3/../../gcrt1.o 
/lib/gcc-lib/i386-unknown-gnu0.3/../../crti.o 
/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/crtbegin.o 
-L/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2 
-L/tmp/gcc/bin/../lib/gcc-lib 
-L/lib/gcc-lib/i386-unknown-gnu0.3/../../../i386-unknown-gnu0.3/lib 
-L/tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/../../.. 
-L/lib/gcc-lib/i386-unknown-gnu0.3/../.. /tmp/cc8dp0ef.o -lgcc -lgcc_eh -lc 
-lgcc -lgcc_eh /tmp/gcc/bin/../lib/gcc-lib/i386-unknown-gnu0.3/3.3.2/crtend.o 
/lib/gcc-lib/i386-unknown-gnu0.3/../../crtn.o
============================================================
------- End of forwarded message -------




reply via email to

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