[gcc r17-2281] Allow tm files to add generator programs

Nathan Sidwell via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:3355aaa5f55d524eefb7f3638ceb1da793dc6275

commit r17-2281-g3355aaa5f55d524eefb7f3638ceb1da793dc6275
Author: Nathan Sidwell <[email protected]>
Date:   Mon Jun 22 14:26:07 2026 -0400

    Allow tm files to add generator programs
    
            gcc/
            * Makefile.in (genprogrtl, genprogmd, genprogerr, genprog): Append,
            rather than set.
            * config/riscv/t-riscv: Delete genrvv-type-indexer workaround rule,
            it is no longer needed.

Diff:
---
 gcc/Makefile.in          | 12 ++++++++----
 gcc/config/riscv/t-riscv |  6 +-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 06e711094efd..fa46ada4980f 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3371,21 +3371,25 @@ build/gencfn-macros.o : gencfn-macros.cc $(BCONFIG_H) $(SYSTEM_H)	\
 # since they need to run on this machine
 # even if GCC is being compiled to run on some other machine.
 
+# We append to the genFOO variables so that target make fragments can
+# add programs to them (those includes have already been included).
+# Example: riscv/t-riscv
+
 # All these programs use the RTL reader ($(BUILD_RTL)).
-genprogrtl = attr attr-common attrtab automata codes conditions config emit \
+genprogrtl += attr attr-common attrtab automata codes conditions config emit \
 	     extract flags mddump opinit output peep preds recog target-def
 $(genprogrtl:%=build/gen%$(build_exeext)): $(BUILD_RTL)
 
 # All these programs use the MD reader ($(BUILD_MD)).
-genprogmd = $(genprogrtl) mddeps constants enums
+genprogmd += $(genprogrtl) mddeps constants enums
 $(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_MD)
 
 # All these programs need to report errors.
-genprogerr = $(genprogmd) genrtl modes gtype hooks cfn-macros condmd
+genprogerr += $(genprogmd) genrtl modes gtype hooks cfn-macros condmd
 $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS)
 
 # Remaining build programs.
-genprog = $(genprogerr) check checksum match
+genprog += $(genprogerr) check checksum match
 
 # These programs need libs over and above what they get from the above list.
 build/genautomata$(build_exeext) : BUILD_LIBS += -lm
diff --git a/gcc/config/riscv/t-riscv b/gcc/config/riscv/t-riscv
index 1f06a3697b61..2a4a2ccab505 100644
--- a/gcc/config/riscv/t-riscv
+++ b/gcc/config/riscv/t-riscv
@@ -203,10 +203,6 @@ $(common_out_file): $(srcdir)/config/riscv/riscv-cores.def \
 build/genrvv-type-indexer.o: $(srcdir)/config/riscv/genrvv-type-indexer.cc $(BCONFIG_H) $(SYSTEM_H)	\
   $(CORETYPES_H) $(GTM_H) errors.h $(GENSUPPORT_H)
 
-build/genrvv-type-indexer$(build_exeext): build/genrvv-type-indexer.o
-	+$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
-	    $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
-
 $(srcdir)/config/riscv/riscv-vector-builtins.def: riscv-vector-type-indexer.gen.def
 $(srcdir)/config/riscv/riscv-vector-builtins.h: $(srcdir)/config/riscv/riscv-vector-builtins.def
 $(srcdir)/config/riscv/sifive-vector-builtins-functions.def: riscv-vector-type-indexer.gen.def
@@ -219,7 +215,7 @@ s-riscv-vector-type-indexer.gen.defs: build/genrvv-type-indexer$(build_exeext)
 	$(SHELL) $(srcdir)/../move-if-change tmp-riscv-vector-type-indexer.gen.def    riscv-vector-type-indexer.gen.def
 	$(STAMP) s-riscv-vector-type-indexer.gen.defs
 
-genprog+=rvv-type-indexer
+genprog += rvv-type-indexer
 
 RISCV_EXT_DEFS = \
   $(srcdir)/config/riscv/riscv-ext.def \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.