https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85433

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If you use -save-temps -v and rerun the lto1 invocation printed in there, it is
colored.
The way -fdiagnostics-color=auto works is it verifies TERM is not dumb and that
isatty (2).
The problem with LTO is that the latter is not the case, collect2 creates a
file
instead lderrout = make_temp_file (".le"); and uses that as stderr of the
linker which is what becomes stderr of lto1 too.
Dunno why we need to use files for there, if that is the case, perhaps either
collect2 or gcc driver should for -flto linking and -fdiagnostics-color=auto
(or if that is the default, for lack of -fdiagnostics-color too) check whether
the stderr is a terminal and if yes, pass -fdiagnostics-color=always instead.

Reply via email to