This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how to compile gcc with profiling on..
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: <perugupa at csee dot wvu dot edu>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 27 Jan 2004 13:21:08 -0800
- Subject: Re: how to compile gcc with profiling on..
- References: <1221.157.182.195.239.1075228207.squirrel@www.csee.wvu.edu>
<perugupa@csee.wvu.edu> writes:
> Hi,
> I am trying to compile gcc(any version) with profiling on in the sense
> that when ever i compile a program say "gcc some.c" i should get the
> profile of gcc what happend in 'gcc' not in 'some.c'.then i nee to run
> all the test cases in gcc and get the profiles of gcc in each case.
> i thought i should do that at building time..i tried the following...but
> was not successful.can anybody help me in compiling gcc with profiling
> on.
The CFLAGS setting to configure does not stick.
You need to do this:
>> $ cd /src/
>> $ mkdir devel inst; cd devel
$ ../gcc/configure --prefix=/src/inst --enable-languages=c,c++ \
--disable-checking
$ make -j8 all CFLAGS="-g -profile -O2"
$ make install
Critical differences include:
* Profiles are useless unless generated with --disable-checking.
* The CFLAGS setting goes on the make command line.
* You must use "make all" in this case, not "make bootstrap".
* "-g -profile -O2" is the correct set of options to use.
zw