]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Allow tm files to add generator programs
authorNathan Sidwell <nathan@acm.org>
Mon, 22 Jun 2026 18:26:07 +0000 (14:26 -0400)
committerNathan Sidwell <nathan@acm.org>
Thu, 9 Jul 2026 15:52:43 +0000 (11:52 -0400)
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.

gcc/Makefile.in
gcc/config/riscv/t-riscv

index 06e711094efde0b27bfb10316285947e41c216c0..fa46ada4980ff8fcbdba696f46e81f59b83dc4b4 100644 (file)
@@ -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
index 1f06a3697b61236212592fef98971ab45544a097..2a4a2ccab505cee396853b15e58ac1d88162386a 100644 (file)
@@ -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 \