This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to compile gcc with profiling on..


<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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]