* How to compile gcc with no optimization and "-gdwarf-2 -g3"
@ 2005-06-17 12:10 Liu Haibin
2005-06-17 14:46 ` Rupert Wood
0 siblings, 1 reply; 3+ messages in thread
From: Liu Haibin @ 2005-06-17 12:10 UTC (permalink / raw)
To: gcc-help
Hi,
I want to build the whole gcc with "-gdwarf-2 -g3" and without any
optimization, so that I can debug gcc and see all the macros. I'm not
familiar with configure and make, so I tried to change all the CFLAGS
and others flags to "-gdwarf-2 -g3" in all the related files
(configure, configure.in, Makefile, Makefile.in, and Makefile.tpl). I
even changed the src/gcc/configure, src/gcc/Makefile.in and other
files. Basically, as long as I see something like "-g -O2", I change
it to "-gdwarf-2 -g3". And I configure it with
# ./configure --with-dwarf2
# make
But when it's compiling, I still see the -O2 optimization. And I tried
# ./configure --with-dwarf2
# make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
BOOT_CFLAGS='-gdwarf-2 -g3'
It's still the same. I can see the -O2 optimization. When I debug cc1,
I cannot see the macros. (I applied the patch to gdb so that it is
able to see macros)
How should I do to compile gcc with no optimization and "-gdwarf-2 -g3"?
Thanks.
Regards,
Timothy
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: How to compile gcc with no optimization and "-gdwarf-2 -g3"
2005-06-17 12:10 How to compile gcc with no optimization and "-gdwarf-2 -g3" Liu Haibin
@ 2005-06-17 14:46 ` Rupert Wood
2005-06-20 1:38 ` Liu Haibin
0 siblings, 1 reply; 3+ messages in thread
From: Rupert Wood @ 2005-06-17 14:46 UTC (permalink / raw)
To: 'Liu Haibin'; +Cc: gcc-help
Timothy wrote:
> And I tried
>
> # ./configure --with-dwarf2
> # make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
> BOOT_CFLAGS='-gdwarf-2 -g3'
I haven't done this for a while but I used to pass all the flags to
configure too, i.e.
# CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
BOOT_CFLAGS='-gdwarf-2 -g3' ./configure --with-dwarf2
# make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
BOOT_CFLAGS='-gdwarf-2 -g3'
or just export them in advance (shell-specific)
export CFLAGS='-gdwarf-2 -g3'
export LIBCFLAGS='-gdwarf-2 -g3'
export BOOT_CFLAGS='-gdwarf-2 -g3'
./configure --with-dwarf2
make
Note that BOOT_CFLAGS probably won't make any difference since you're not
using "make bootstrap". If you're not building with a similar version of GCC
then you might want to bootstrap the compiler instead, but it sounds like
you know what you're doing!
Rup.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to compile gcc with no optimization and "-gdwarf-2 -g3"
2005-06-17 14:46 ` Rupert Wood
@ 2005-06-20 1:38 ` Liu Haibin
0 siblings, 0 replies; 3+ messages in thread
From: Liu Haibin @ 2005-06-20 1:38 UTC (permalink / raw)
To: gcc-help
Yes. It worked. Thanks a lot.
Regards,
Timothy
On 6/17/05, Rupert Wood <me@rupey.net> wrote:
> Timothy wrote:
>
> > And I tried
> >
> > # ./configure --with-dwarf2
> > # make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
> > BOOT_CFLAGS='-gdwarf-2 -g3'
>
> I haven't done this for a while but I used to pass all the flags to
> configure too, i.e.
>
> # CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
> BOOT_CFLAGS='-gdwarf-2 -g3' ./configure --with-dwarf2
> # make CFLAGS='-gdwarf-2 -g3' LIBCFLAGS='-gdwarf-2 -g3'
> BOOT_CFLAGS='-gdwarf-2 -g3'
>
> or just export them in advance (shell-specific)
>
> export CFLAGS='-gdwarf-2 -g3'
> export LIBCFLAGS='-gdwarf-2 -g3'
> export BOOT_CFLAGS='-gdwarf-2 -g3'
> ./configure --with-dwarf2
> make
>
> Note that BOOT_CFLAGS probably won't make any difference since you're not
> using "make bootstrap". If you're not building with a similar version of GCC
> then you might want to bootstrap the compiler instead, but it sounds like
> you know what you're doing!
>
> Rup.
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-20 1:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-17 12:10 How to compile gcc with no optimization and "-gdwarf-2 -g3" Liu Haibin
2005-06-17 14:46 ` Rupert Wood
2005-06-20 1:38 ` Liu Haibin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).