Re: [-mm patch] AFLAGS: fix the -g setting

Adrian Bunk
2007-08-16T22:17:00Z

On Thu, Aug 16, 2007 at 02:02:01PM -0700, Andrew Morton wrote:
> On Tue, 14 Aug 2007 23:23:29 +0200
> Adrian Bunk <bunk@kernel.org> wrote:
>
> > It's -gdwarf-2, not -gdwarf2. With this fix it can actually work.
>
> Andreas Schwab has said "The option is officially called -gdwarf-2, and
> -gdwarf2 is an alias for backward compatibility.". So the code should be
> working OK now.

Both GNU gcc 3.2.3 downloaded from ftp.gnu.org and the
Debian GNU/Linux package of GNU gcc 4.2.1 disagree with Andreas:

$ gcc -O2 -gdwarf-2 test.c
$ gcc -O2 -gdwarf2 test.c
cc1: error: unrecognised debug output level "dwarf2"
$ gcc --version
gcc (GCC) 4.2.1 (Debian 4.2.1-0)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /usr/local/DIR/gcc-3.2.3/bin/gcc -O2 -gdwarf2 test.c
cc1: use -gdwarf -g2 for DWARF v1, level 2
cc1: use -gdwarf-2 for DWARF v2
$

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed