Here are some numbers obtained by grepping the build log:
First, for gn bootstrapping, ninja doesn't run in verbose mode, so I can't see the command lines. I count 308 + 16 invocations of CXX + CC and I think they respect the flags.
Then, gn is rebuilt using itself, and again ninja isn't verbose. There are 533 + 73 invocations of CXX + CC, but this time I believe they don't respect the flags. (I looked at one object file in each case for clues.)
During the main ninja run, there are 12277 and 667 invocations of /usr/bin/x86_64-pc-linux-gnu-g++ and /usr/bin/x86_64-pc-linux-gnu-gcc, respectively. With CXX and CC, there should be no path. More importantly, only 91 and zero use the proper *FLAGS values. 13 g++ invocations do linking and none of them respects LDFLAGS.
Finally there are 82 invocations of x86_64-pc-linux-gnu-g++ directly from make which do respect all flags. 7 of them do linking.
In summary, only a tiny fraction of the files get built with the correct *FLAGS. Almost everything generated with gn doesn't respect them. All the stuff inherited from chromium doesn't. Interestingly, there are a few qt-specific files with the *FLAGS applied in the gn generated batch; they could give a clue how the flags could be handled for the rest.
(In reply to Alexander Miller from comment #0)
> for gn bootstrapping, ninja doesn't run in verbose mode, so I can't
> see the command lines.
Patch #1 from patchset in bug #630834 should increase verbosity.
*** Bug 697594 has been marked as a duplicate of this bug. ***
*** Bug 748237 has been marked as a duplicate of this bug. ***