public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/105412] New: [10/11/12 Regression] Missing phony target with -MP for first include when compiling from stdin
@ 2022-04-27 21:09 jsm28 at gcc dot gnu.org
  2022-04-27 21:20 ` [Bug preprocessor/105412] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2022-04-27 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105412
           Summary: [10/11/12 Regression] Missing phony target with -MP
                    for first include when compiling from stdin
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
  Target Milestone: ---

When generating dependencies with -M -MP, the phony target for the first
included header (typically stdc-predef.h) is missing if compiling from stdin,
with GCC 10 and later but not with GCC 9.  For example:

$ echo "#include <cstdlib>" |
./many9/install/compilers/x86_64-linux-gnu/bin/x86_64-glibc-linux-gnu-g++ -M
-MP -x c++ - | grep stdc-predef

/scratch/jmyers/glibc/many9/install/compilers/x86_64-linux-gnu/sysroot/usr/include/stdc-predef.h
\
/scratch/jmyers/glibc/many9/install/compilers/x86_64-linux-gnu/sysroot/usr/include/stdc-predef.h:

shows the expected phony target (the second line of output) with a GCC 9
compiler, but

$ echo "#include <cstdlib>" |
./many10/install/compilers/x86_64-linux-gnu/bin/x86_64-glibc-linux-gnu-g++ -M
-MP -x c++ - | grep stdc-predef

/scratch/jmyers/glibc/many10/install/compilers/x86_64-linux-gnu/sysroot/usr/include/stdc-predef.h
\

shows that line of output is missing with GCC 10 and later.

(This example is adapted from code in glibc's configure script, but the bug
only actually causes problems with glibc when the compiler is used with an old
sysroot lacking stdc-predef.h and so the missing phony target is that for
<cstdlib> itself.)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 21:09 [Bug preprocessor/105412] New: [10/11/12 Regression] Missing phony target with -MP for first include when compiling from stdin jsm28 at gcc dot gnu.org
2022-04-27 21:20 ` [Bug preprocessor/105412] " pinskia at gcc dot gnu.org
2022-04-28 16:26 ` [Bug preprocessor/105412] [10/11/12/13 " jakub at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2022-07-26 11:44 ` rguenth at gcc dot gnu.org
2023-07-07 10:43 ` [Bug preprocessor/105412] [11/12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).