[google] record compiler options to .note sections

Xinliang David Li davidxl@google.com
Mon Oct 10 22:50:00 GMT 2011


Ok for google branches.

1) document the difference of this option with -grecord-gcc-switches
(this one only record codegen related options, and recorded in debug
section), and with -frecord-gcc-switches?
2) may be better to use option name: -frecord-gcc-switches-in-object

thanks,

David

On Sun, Oct 9, 2011 at 6:16 PM, Dehao Chen <dehao@google.com> wrote:
> On Sun, Oct 9, 2011 at 5:28 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Sun, Oct 09, 2011 at 09:18:25AM +0800, Dehao Chen wrote:
>>> Unfortunately -frecord-gcc-switches cannot serve our purpose because
>>> the recorded switches are mergable, i.e. the linker will merge all
>>> options to a set of strings. However, object files may have distinct
>>> compile options. We want to preserve every object file's compile
>>> options when doing LIPO build.
>>
>> And -grecord-gcc-switches?  That one, although it is mergeable, still
>> preserves every object files's compile options.
>
> I tried -grecord-gcc-switches, but looks like it's not recording
> options that I want.
>
> e.g. the following two commands output the same assembly code, while
> the former should record one more options.
>
> gcc -g3 -grecord-gcc-switches a.c -Dabcdefgh -Dxyzzzz -I/usr/ -S
> gcc -g3 -grecord-gcc-switches a.c -Dabcdefgh -Dxyzzzz -S
>
> Thanks,
> Dehao
>
>>
>>        Jakub
>>
>



More information about the Gcc-patches mailing list