[google] record compiler options to .note sections

Dehao Chen dehao@google.com
Mon Oct 10 07:09:00 GMT 2011


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