FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 10-30-2010, 06:24 AM
Jon Stanley
 
Default -frecord-gcc-switches as default CFLAG?

I noticed on my Fedora 13 box that in the RPM macro %__global_cflags
that -frecord-gcc-switches is missing, which is a nifty compiler
feature that will record the flags passed to gcc in a section in the
object file, thus aiding in the "how in the world was this compiled?"
problem. An example:

[jstanley@hawtness ~]$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c
[jstanley@hawtness ~]$ readelf -p .GCC.command.line hello

String dump of section '.GCC.command.line':
[ 0] hello.c
[ 8] -mtune=generic
[ 17] -g
[ 1a] -O2
[ 1e] -frecord-gcc-switches

What do folks think about adding this as a default? Any reason not to
(other than possibly a few bytes extra in the object files)?
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 10-30-2010, 10:01 AM
"Richard W.M. Jones"
 
Default -frecord-gcc-switches as default CFLAG?

On Sat, Oct 30, 2010 at 02:24:02AM -0400, Jon Stanley wrote:
> I noticed on my Fedora 13 box that in the RPM macro %__global_cflags
> that -frecord-gcc-switches is missing, which is a nifty compiler
> feature that will record the flags passed to gcc in a section in the
> object file, thus aiding in the "how in the world was this compiled?"
> problem. An example:
>
> [jstanley@hawtness ~]$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c
> [jstanley@hawtness ~]$ readelf -p .GCC.command.line hello
>
> String dump of section '.GCC.command.line':
> [ 0] hello.c
> [ 8] -mtune=generic
> [ 17] -g
> [ 1a] -O2
> [ 1e] -frecord-gcc-switches
>
> What do folks think about adding this as a default? Any reason not to
> (other than possibly a few bytes extra in the object files)?

+1

I think would also catch those cases where some gcc flag is found to
break code generation. You reasonably see which binaries were
affected.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-01-2010, 12:04 PM
"Tom "spot" Callaway"
 
Default -frecord-gcc-switches as default CFLAG?

On 10/30/2010 06:01 AM, Richard W.M. Jones wrote:
> On Sat, Oct 30, 2010 at 02:24:02AM -0400, Jon Stanley wrote:
>> I noticed on my Fedora 13 box that in the RPM macro %__global_cflags
>> that -frecord-gcc-switches is missing, which is a nifty compiler
>> feature that will record the flags passed to gcc in a section in the
>> object file, thus aiding in the "how in the world was this compiled?"
>> problem. An example:
>>
>> [jstanley@hawtness ~]$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c
>> [jstanley@hawtness ~]$ readelf -p .GCC.command.line hello
>>
>> String dump of section '.GCC.command.line':
>> [ 0] hello.c
>> [ 8] -mtune=generic
>> [ 17] -g
>> [ 1a] -O2
>> [ 1e] -frecord-gcc-switches
>>
>> What do folks think about adding this as a default? Any reason not to
>> (other than possibly a few bytes extra in the object files)?
>
> +1
>
> I think would also catch those cases where some gcc flag is found to
> break code generation. You reasonably see which binaries were
> affected.

I agree. Unless there is a notable performance cost in this, I say we
should go for it.

~spot
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-01-2010, 12:08 PM
Josh Boyer
 
Default -frecord-gcc-switches as default CFLAG?

On Mon, Nov 1, 2010 at 9:04 AM, Tom "spot" Callaway <tcallawa@redhat.com> wrote:
> On 10/30/2010 06:01 AM, Richard W.M. Jones wrote:
>> On Sat, Oct 30, 2010 at 02:24:02AM -0400, Jon Stanley wrote:
>>> I noticed on my Fedora 13 box that in the RPM macro %__global_cflags
>>> that -frecord-gcc-switches is missing, which is a nifty compiler
>>> feature that will record the flags passed to gcc in a section in the
>>> object file, thus aiding in the "how in the world was this compiled?"
>>> problem. An example:
>>>
>>> [jstanley@hawtness ~]$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c
>>> [jstanley@hawtness ~]$ readelf -p .GCC.command.line hello
>>>
>>> String dump of section '.GCC.command.line':
>>> * [ * * 0] *hello.c
>>> * [ * * 8] *-mtune=generic
>>> * [ * *17] *-g
>>> * [ * *1a] *-O2
>>> * [ * *1e] *-frecord-gcc-switches
>>>
>>> What do folks think about adding this as a default? Any reason not to
>>> (other than possibly a few bytes extra in the object files)?
>>
>> +1
>>
>> I think would also catch those cases where some gcc flag is found to
>> break code generation. *You reasonably see which binaries were
>> affected.
>
> I agree. Unless there is a notable performance cost in this, I say we
> should go for it.

How do you envision this working with debuginfo? Does this section
get stripped out from normal install and collected into the -debuginfo
subpackage, or does debuginfo need to be taught to leave this section
intact in the actual installed binary?

josh
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-01-2010, 12:12 PM
Jakub Jelinek
 
Default -frecord-gcc-switches as default CFLAG?

On Mon, Nov 01, 2010 at 09:04:12AM -0400, Tom "spot" Callaway wrote:
> On 10/30/2010 06:01 AM, Richard W.M. Jones wrote:
> > On Sat, Oct 30, 2010 at 02:24:02AM -0400, Jon Stanley wrote:
> >> I noticed on my Fedora 13 box that in the RPM macro %__global_cflags
> >> that -frecord-gcc-switches is missing, which is a nifty compiler
> >> feature that will record the flags passed to gcc in a section in the
> >> object file, thus aiding in the "how in the world was this compiled?"
> >> problem. An example:
> >>
> >> [jstanley@hawtness ~]$ gcc -O2 -frecord-gcc-switches -g -o hello hello.c
> >> [jstanley@hawtness ~]$ readelf -p .GCC.command.line hello
> >>
> >> String dump of section '.GCC.command.line':
> >> [ 0] hello.c
> >> [ 8] -mtune=generic
> >> [ 17] -g
> >> [ 1a] -O2
> >> [ 1e] -frecord-gcc-switches
> >>
> >> What do folks think about adding this as a default? Any reason not to
> >> (other than possibly a few bytes extra in the object files)?
> >
> > +1
> >
> > I think would also catch those cases where some gcc flag is found to
> > break code generation. You reasonably see which binaries were
> > affected.
>
> I agree. Unless there is a notable performance cost in this, I say we
> should go for it.

-frecord-gcc-switches is unfortunately pretty much useless, see
http://gcc.gnu.org/PR32998. Please don't add it, we want something actually
usable, not this option.

Jakub
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-01-2010, 05:32 PM
Jon Stanley
 
Default -frecord-gcc-switches as default CFLAG?

On Mon, Nov 1, 2010 at 9:12 AM, Jakub Jelinek <jakub@redhat.com> wrote:

> -frecord-gcc-switches is unfortunately pretty much useless, see
> http://gcc.gnu.org/PR32998. *Please don't add it, we want something actually
> usable, not this option.

Isn't it more useful in this state than not having the data at all? It
seems that the bug that you refer to is about appending things to
DW_AT_producer at this point, which is also useful, but I'm not
convinced about that use of DW_AT_producer either, but that's another
thread.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 07:49 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org