This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch+7.9] compile: Filter out -fpreprocessed
- From: Mark Wielaard <mjw at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches <gdb-patches at sourceware dot org>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 03 Feb 2015 20:10:35 +0100
- Subject: Re: [patch+7.9] compile: Filter out -fpreprocessed
- Authentication-results: sourceware.org; auth=none
- References: <20150116224234 dot GA6176 at host2 dot jankratochvil dot net> <CADPb22SBOPJAS4vDNX_SESXupv6NiYiPxbxa1WmQogDVtqchQQ at mail dot gmail dot com> <20150203185912 dot GA26920 at host1 dot jankratochvil dot net>
On Tue, 2015-02-03 at 19:59 +0100, Jan Kratochvil wrote:
> On Tue, 03 Feb 2015 19:50:40 +0100, Doug Evans wrote:
> > On Fri, Jan 16, 2015 at 2:42 PM, Jan Kratochvil
> > <jan.kratochvil@redhat.com> wrote:
> > > [...]
> > > It is wrong that gcc puts -fpreprocessed into DW_AT_producer - I may post a gcc
> > > patch for it.
> >
> > I wasn't aware there are now rules for what can and cannot go in DW_AT_producer.
> > DW_AT_producer has gone from being informational to having a formal
> > spec (in the sense that something will break if, for example, a
> > particular option is mentioned).
> > Is this spec written down somewhere? [At least guidelines for what
> > things may lead to breakage?]
>
> No. Do you have a suggestion where to put it? Should it be only a GNU
> extension or should it be even DWARF-standardized?
The gcc documentation describes it:
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
-grecord-gcc-switches
This switch causes the command-line options used to invoke the
compiler that may affect code generation to be appended to the
DW_AT_producer attribute in DWARF debugging information. The
options are concatenated with spaces separating them from each
other and from the compiler version. See also
-frecord-gcc-switches for another way of storing compiler
options into the object file. This is the default.
-gno-record-gcc-switches
Disallow appending command-line options to the DW_AT_producer
attribute in DWARF debugging information.
So Jan is right that gcc adding -fpreprocessed, which doesn't affect
code generation, but is a preprocessor option, shouldn't be there.
Cheers,
Mark