On 3/4/20 6:33 PM, Jakub Jelinek wrote:
On Wed, Mar 04, 2020 at 06:23:10PM +0100, Martin Liška wrote:
On 3/4/20 4:25 PM, Egeyar Bagcioglu wrote:
Thanks Richard.

I do not have write-access to the GCC repo. I'd be glad if someone commits it 
for me.

Can we please wait? I'm really convinced we do not want one another very similar
functionality. I would definitely recommend to change the semantics
of -frecord-gcc-switches to what the patchset does.

That's why I added Nick as he's the author of the original implementation.
Reasoning is provided in my previous email.

Also, what is the reason for storing the option in a file, rather than say
putting them into an environment variable from which the backend can pick it
up?

That's smart suggestion! It would not be the first environment variable that
we use, right?

 I must say I don't really see advantages of this over
-grecord-gcc-switches, recording all options looks very bloaty and will
include mostly stuff you don't really care about (such as, e.g. the -I
options without knowing what was the current directory when the source file
has been compiled), on the other side will not record interesting options
that -grecord-gcc-switches records (say, if some code is compiled with
-march=native, this new option will record that, rather than what it really
is), but I won't stand in a way unless such an option would be on by
default.

Yes, it's a minor disadvantage. On the other hand one can check the fortify
macros. I don't care much about them too, but what's the biggest benefit to me
is that each argument will not go into it's own mergeable section. Then
you will not see something like:

$ gcc -O0 foo.c -frecord-gcc-switches -c -g
$ gcc -Ofast bar.c -frecord-gcc-switches -c -g0
$ gcc foo.o bar.o
$ readelf -p .GCC.command.line a.out

String dump of section '.GCC.command.line':
  [     0]  foo.c
  [     6]  -mtune=generic
  [    15]  -march=x86-64
  [    23]  -g
  [    26]  -O0
  [    2a]  -frecord-gcc-switches
  [    40]  bar.c
  [    46]  -g0
  [    4a]  -Ofast

The output is useless and can't disambiguate each compiler
invocations.

Martin


        Jakub


Reply via email to