devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Sergei Trofimovich <slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 2/2] Makefile: fix infinite recursion by dropping non-existent `%.output`
Date: Sun, 25 Sep 2022 11:42:03 +0100	[thread overview]
Message-ID: <20220925104203.648449-2-slyich@gmail.com> (raw)
In-Reply-To: <20220925104203.648449-1-slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Without the change GNU `make-4.4` falls into infinite recursion of trying
to generate %.output files (bison is not passed flags to generate debug
output).

This happens on GNU `make-4.4` only after GNU make change to more eagerly
rebuild all target outputs in multiple targets:
    https://savannah.gnu.org/bugs/index.php?63098

The recursion here is the following:

- Makefile depends on *.d files
- *.d files depend on *.c files
- *.c files are generated by bison
- bison is triggered whenever some of it's multiple targets are missing

In our case `%.output` is always missing and bison is always reran.
*.d files are always regenerated on `make` run. And make is always
restarted as *.d files are always regenerated.

The fix removes infeasible `%.output`.

Signed-off-by: Sergei Trofimovich <slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e7a0dcb..d4e7551 100644
--- a/Makefile
+++ b/Makefile
@@ -384,7 +384,7 @@ clean: libfdt_clean pylibfdt_clean tests_clean
 	@$(VECHO) LEX $@
 	$(LEX) -o$@ $<
 
-%.tab.c %.tab.h %.output: %.y
+%.tab.c %.tab.h: %.y
 	@$(VECHO) BISON $@
 	$(BISON) -b $(basename $(basename $@)) -d $<
 
-- 
2.37.2


  parent reply	other threads:[~2022-09-25 10:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 10:42 [PATCH 1/2] Makefile: limit make re-execution to avoid infinite spin Sergei Trofimovich
     [not found] ` <20220925104203.648449-1-slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-25 10:42   ` Sergei Trofimovich [this message]
     [not found]     ` <20220925104203.648449-2-slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-26  5:24       ` [PATCH 2/2] Makefile: fix infinite recursion by dropping non-existent `%.output` David Gibson

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=20220925104203.648449-2-slyich@gmail.com \
    --to=slyich-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).