From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: [PATCH v3 4/6] x86: add generated tables dependency check to gas
Date: Mon, 28 Nov 2022 12:32:07 +0100 [thread overview]
Message-ID: <c8f5780b-072e-b184-f153-3c2af7ea577e@suse.com> (raw)
In-Reply-To: <8f385c36-cfe5-1b0a-45b6-ea6c008b20c8@suse.com>
As requested by H.J., just for the sake of people potentially building
in gas/ alone, add a check that the generated files in opcodes/ are
actually up-to-date. Personally I think this should at best be a
warning, but I can see how this may not be easily noticable among other
make output (depending in particular on the verbosity level).
---
v3: New.
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -446,6 +446,17 @@ development.exp: $(BFDDIR)/development.s
$(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \
| $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
+config/tc-i386.o: $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h
+
+i386_tbl_deps = $(srcdir)/../opcodes/i386-opc.tbl \
+ $(srcdir)/../opcodes/i386-reg.tbl \
+ $(srcdir)/../opcodes/i386-gen.c $(srcdir)/../opcodes/i386-opc.h
+
+$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h: @MAINT@ $(i386_tbl_deps)
+ @echo '"$@" is outdated wrt "$?"' >&2
+ @echo 'Please rebuild from the top level or in $(CURDIR)/../opcodes/' >&2
+ @false
+
EXTRA_as_new_SOURCES += config/m68k-parse.y
config/m68k-parse.c: $(srcdir)/config/m68k-parse.y
$(SHELL) $(YLWRAP) $(srcdir)/config/m68k-parse.y y.tab.c $@ -- $(YACCCOMPILE)
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -902,6 +902,10 @@ EXTRA_as_new_SOURCES = $(CFILES) $(HFILE
EXPECT = expect
RUNTEST = runtest
RUNTESTFLAGS =
+i386_tbl_deps = $(srcdir)/../opcodes/i386-opc.tbl \
+ $(srcdir)/../opcodes/i386-reg.tbl \
+ $(srcdir)/../opcodes/i386-gen.c $(srcdir)/../opcodes/i386-opc.h
+
itbl_test_SOURCES = itbl-parse.y itbl-lex.l
itbl_test_LDADD = itbl-tops.@OBJEXT@ itbl-test.@OBJEXT@ $(GASLIBS) @LEXLIB@
@@ -2060,6 +2064,13 @@ check-DEJAGNU: site.exp
development.exp: $(BFDDIR)/development.sh
$(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \
| $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
+
+config/tc-i386.o: $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h
+
+$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h: @MAINT@ $(i386_tbl_deps)
+ @echo '"$@" is outdated wrt "$?"' >&2
+ @echo 'Please rebuild from the top level or in $(CURDIR)/../opcodes/' >&2
+ @false
config/m68k-parse.c: $(srcdir)/config/m68k-parse.y
$(SHELL) $(YLWRAP) $(srcdir)/config/m68k-parse.y y.tab.c $@ -- $(YACCCOMPILE)
config/m68k-parse.h: config/m68k-parse.c
next prev parent reply other threads:[~2022-11-28 11:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 11:29 [PATCH v3 0/6] x86: break gas dependency on libopcodes Jan Beulich
2022-11-28 11:30 ` [PATCH v3 1/6] x86: instantiate i386_{op,reg}tab[] in gas instead of in libopcodes Jan Beulich
2022-11-28 11:31 ` [PATCH v3 2/6] x86: remove i386-opc.c Jan Beulich
2022-11-28 11:31 ` [PATCH v3 3/6] x86: break gas dependency on libopcodes Jan Beulich
2022-11-28 11:32 ` Jan Beulich [this message]
2022-11-28 11:32 ` [PATCH v3 5/6] x86: drop sentinel from i386_optab[] Jan Beulich
2022-11-28 11:33 ` [PATCH v3 6/6] x86: generate template sets data at build time Jan Beulich
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=c8f5780b-072e-b184-f153-3c2af7ea577e@suse.com \
--to=jbeulich@suse.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
/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).