blob: 6b6925735d2475f9e2ae1708d91950a2276d4a3d [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 2/5] gcc: Fix "argument list too long" from install-plugins
Andrew Geissler82c905d2020-04-13 13:39:40 -05003
Andrew Geisslereff27472021-10-29 15:35:00 -05004When building in longer build paths (200+ characters), the
5"echo $(PLUGIN_HEADERS)" from the install-plugins target would cause an
6"argument list too long error" on some systems.
Andrew Geissler82c905d2020-04-13 13:39:40 -05007
Andrew Geisslereff27472021-10-29 15:35:00 -05008Avoid this by calling make's sort function on the list which removes
9duplicates and stops the overflow from reaching the echo command.
10The original sort is left to handle the the .h and .def files.
Andrew Geissler82c905d2020-04-13 13:39:40 -050011
Andrew Geisslereff27472021-10-29 15:35:00 -0500122021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org>
Andrew Geissler82c905d2020-04-13 13:39:40 -050013
Andrew Geisslereff27472021-10-29 15:35:00 -050014gcc/ChangeLog:
Andrew Geissler82c905d2020-04-13 13:39:40 -050015
Andrew Geisslereff27472021-10-29 15:35:00 -050016 * Makefile.in: Fix "argument list too long" from install-plugins
Andrew Geissler635e0e42020-08-21 15:58:33 -050017
Andrew Geisslereff27472021-10-29 15:35:00 -050018Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
19
20Upstream-Status: Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582722.html]
Andrew Geissler82c905d2020-04-13 13:39:40 -050021---
22 gcc/Makefile.in | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
Andrew Geisslereff27472021-10-29 15:35:00 -050025Index: gcc-11.2.0/gcc/Makefile.in
26===================================================================
27--- gcc-11.2.0.orig/gcc/Makefile.in
28+++ gcc-11.2.0/gcc/Makefile.in
29@@ -3678,7 +3678,7 @@ install-plugin: installdirs lang.install
Andrew Geisslerc926e172021-05-07 16:11:35 -050030 # We keep the directory structure for files in config, common/config or
31 # c-family and .def files. All other files are flattened to a single directory.
Andrew Geissler82c905d2020-04-13 13:39:40 -050032 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
33- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
Andrew Geissler635e0e42020-08-21 15:58:33 -050034+ headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
36 for file in $$headers; do \
37 if [ -f $$file ] ; then \