public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "allan.w.macdonald at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/109183] [regression?] since GCC 11.1, -MM -MMD generates "a-" prefixed dependency files
Date: Thu, 13 Apr 2023 19:27:59 +0000	[thread overview]
Message-ID: <bug-109183-4-o9RKmDSsfJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109183-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Allan W. Macdonald <allan.w.macdonald at gmail dot com> ---
The makefiles I've been maintaining contain a mechanism to make sure that any
change in a locally-included file will cause the c file that includes it to be
compiled again, like so:

### Extract of makefile:
%.d: %.c
        gcc -MM -MD $<

-include $(OBJECTS:.o=.d)
###

So, if I understand this correctly (tell me if I'm wrong), preprocessing is
performed to generate the .d files before any file is compiled to an object in
this situation.  These .d files are then included and turned into rules using a
substitution reference.

The 'a-' prefix breaks this mechanism.

The workaround I mentioned,

        gcc -E -MMD $< > /dev/null

seems to achieve the same behaviour but there's probably a better way to do it.

  parent reply	other threads:[~2023-04-13 19:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18 10:36 [Bug preprocessor/109183] New: " yann at droneaud dot fr
2023-03-20  9:19 ` [Bug preprocessor/109183] " rguenth at gcc dot gnu.org
2023-03-21 18:46 ` yann at droneaud dot fr
2023-03-26 19:29 ` aoliva at gcc dot gnu.org
2023-03-27 17:23 ` yann at droneaud dot fr
2023-04-13 16:09 ` allan.w.macdonald at gmail dot com
2023-04-13 16:12 ` allan.w.macdonald at gmail dot com
2023-04-13 16:12 ` pinskia at gcc dot gnu.org
2023-04-13 16:21 ` allan.w.macdonald at gmail dot com
2023-04-13 16:31 ` jakub at gcc dot gnu.org
2023-04-13 16:40 ` schwab@linux-m68k.org
2023-04-13 19:27 ` allan.w.macdonald at gmail dot com [this message]
2023-04-13 21:05 ` pinskia at gcc dot gnu.org
2023-04-14 12:52 ` allan.w.macdonald at gmail dot com
2023-04-14 13:45 ` schwab@linux-m68k.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109183-4-o9RKmDSsfJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).