From: Jakub Jelinek Date: Fri, 23 Oct 2020 08:11:41 +0000 (+0200) Subject: Fix up plugin header install X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a83366b62e585cce5577309013a832f895ccdbf;p=gcc.git Fix up plugin header install Jeff has noticed and I've confirmed that config/i386/i386.h header which is installed on x86 in plugin/include/ directory newly in GCC 11 has which breaks all plugins that include tm.h etc. because that header is not shipped. The following patch seems to fix that. Unfortunately it isn't just a matter of TM_H += t-i386 change, because the header has full path and therefore needs to be installed in its full path. Additionally, I've noticed that the b-header-vars generation is completely broken, it will just throw many of the dependencies away, because it incorrectly removed everything from first ... remaining till the last /, while what it clearly wants to do is remove each ... till last / in the same header path (i.e. instead of .* should have used [^ ]* and g modifier). I've also noticed that some other headers mentioned in #include of other headers aren't included (gomp-constants.h as dependency of omp-general.h and various dependencies of expr.h (where omp-general.h and expr.h were previously installed)). 2020-10-23 Jakub Jelinek * Makefile.in (PLUGIN_HEADERS): Add gomp-constants.h and $(EXPR_H). (s-header-vars): Accept not just spaces but also tabs between *_H name and =. Handle common/config/ headers similarly to config. Don't throw away everything from first ... to last / on the remaining string, instead skip just ... to corresponding last / without intervening spaces and tabs. (install-plugin): Treat common/config headers like config headers. * config/i386/t-i386 (TM_H): Add $(srcdir)/common/config/i386/i386-cpuinfo.h. --- diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 5a8fb0d7612..f883c81ee5d 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3594,7 +3594,8 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \ hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \ lcm.h cfgloopmanip.h file-prefix-map.h builtins.def $(INSN_ATTR_H) \ - pass-instances.def params.list + pass-instances.def params.list $(srcdir)/../include/gomp-constants.h \ + $(EXPR_H) # generate the 'build fragment' b-header-vars s-header-vars: Makefile @@ -3604,7 +3605,7 @@ s-header-vars: Makefile # more portable than a trailing "-e d" to filter out the uninteresting lines, # in particular on ia64-hpux where "s/.../p" only prints if -n was requested # as well. - $(foreach header_var,$(shell sed < Makefile -n -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p'),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\..*/~~') >> tmp-header-vars;) \ + $(foreach header_var,$(shell sed < Makefile -n -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p'),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\./common/config/~common/config/~' -e 's~\.\.\.[^ ]*/~~g') >> tmp-header-vars;) $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars $(STAMP) s-header-vars @@ -3617,8 +3618,8 @@ install-gengtype: installdirs gengtype$(exeext) gtype.state # Install the headers needed to build a plugin. install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype -# We keep the directory structure for files in config or c-family and .def -# files. All other files are flattened to a single directory. +# We keep the directory structure for files in config, common/config or +# c-family and .def files. All other files are flattened to a single directory. $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ @@ -3630,7 +3631,8 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype else continue; \ fi; \ case $$path in \ - "$(srcdir)"/config/* | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ + "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \ + | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \ *) base=`basename $$path` ;; \ esac; \ diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386 index 5134e0885ae..e5fb0618fe6 100644 --- a/gcc/config/i386/t-i386 +++ b/gcc/config/i386/t-i386 @@ -17,7 +17,8 @@ # . OPTIONS_H_EXTRA += $(srcdir)/config/i386/stringop.def -TM_H += $(srcdir)/config/i386/x86-tune.def +TM_H += $(srcdir)/config/i386/x86-tune.def \ + $(srcdir)/common/config/i386/i386-cpuinfo.h PASSES_EXTRA += $(srcdir)/config/i386/i386-passes.def i386-c.o: $(srcdir)/config/i386/i386-c.c