Gentoo Archives: gentoo-dev

From: Bengt Gorden <bengan@×××××.se>
To: gentoo-dev@g.o
Subject: [gentoo-dev] gcc -pg not working properly
Date: Thu, 09 Jan 2003 22:35:56
Message-Id: 3E1DF839.80009@sunet.se
1 I tried this on gentoo-user first but didn't get any answere there so I
2 try my luck here.
3
4 I need to profile some programs but it seems to me that gcc with -pg
5 doesn't work in gentoo. I have tested with gcc 2.95.3 and 3.2, on
6 different machines. Both produce gmon.out that is wrong. It has no data
7 in it. I just made a "hello world" to check it. Anyone knows a sollution
8 to this problem?
9
10 bengan@iib tmp $ more hello.c
11 #include <stdio.h>
12
13 int main(void)
14 {
15 printf("Hello World\n");
16 return 0;
17 }
18
19 bengan@iib tmp $ gcc -pg -o hello hello.c
20
21 bengan@iib tmp $ ./hello
22 Hello World
23
24 bengan@iib tmp $ ls -l gmon.out
25 -rw-r--r-- 1 bengan users 283 Jan 9 08:44 gmon.out
26
27 bengan@iib tmp $ gprof hello
28 gprof: gmon.out file is missing call-graph data
29
30 I have tested it on MacOS X with gcc 3.1 and on netbsd with gcc 2.95.3
31 and it works fine.
32
33 /Bengan
34
35
36
37 --
38 gentoo-dev@g.o mailing list