From: "H.J. Lu" <hjl.tools@gmail.com>
To: binutils@sourceware.org
Subject: [PATCH] opcodes: Make i386-init.h depend on i386-tbl.h
Date: Thu, 1 Dec 2022 08:20:38 -0800 [thread overview]
Message-ID: <20221201162038.421271-1-hjl.tools@gmail.com> (raw)
i386-gen will generate both i386-tbl.h and i386-init.h in one go. Since
both i386-tbl.h and i386-init.h depend on i386-gen, it leads to a race
condition for i386-gen. Make i386-init.h depend on i386-tbl.h to avoid
the race condition.
* Makefile.am ($(srcdir)/i386%tbl.h $(srcdir)/i386%init.h):
Removed.
($(srcdir)/i386-tbl.h): New rule.
($(srcdir)/i386-init.h): Likewise.
* Makefile.in: Regenerated.
---
opcodes/Makefile.am | 8 +++++---
opcodes/Makefile.in | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index cb6ff0ebc5e..8565a73e902 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -553,13 +553,15 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \
config.h sysdep.h
$(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
-# i386-gen will generate both headers in one go. Use a pattern rule to properly
-# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
-$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
+# i386-gen will generate both i386-tbl.h and i386-init.h in one go. Make
+# i386-init.h depend on i386-tbl.h to avoid the race condition.
+$(srcdir)/i386-tbl.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
$(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
< $(srcdir)/i386-opc.tbl \
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
+$(srcdir)/i386-init.h: $(srcdir)/i386-tbl.h
+
i386-opc.lo: $(srcdir)/i386-tbl.h
# While not really a dependency, specify i386-init.h here as well to make sure
# it is generated even if i386-tbl.h is present and up-to-date.
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index 5524af5ccd2..ea6fc772def 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -1528,13 +1528,15 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \
config.h sysdep.h
$(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
-# i386-gen will generate both headers in one go. Use a pattern rule to properly
-# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
-$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
+# i386-gen will generate both i386-tbl.h and i386-init.h in one go. Make
+# i386-init.h depend on i386-tbl.h to avoid the race condition.
+$(srcdir)/i386-tbl.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
$(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
< $(srcdir)/i386-opc.tbl \
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
+$(srcdir)/i386-init.h: $(srcdir)/i386-tbl.h
+
i386-opc.lo: $(srcdir)/i386-tbl.h
# While not really a dependency, specify i386-init.h here as well to make sure
# it is generated even if i386-tbl.h is present and up-to-date.
--
2.38.1
next reply other threads:[~2022-12-01 16:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 16:20 H.J. Lu [this message]
2022-12-01 17:08 ` Jan Beulich
2022-12-01 18:16 ` H.J. Lu
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=20221201162038.421271-1-hjl.tools@gmail.com \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.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).