Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 2 | Subject: [PATCH 2/5] gcc: Fix "argument list too long" from install-plugins |
| 3 | |
| 4 | When 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. |
| 7 | |
| 8 | Avoid this by calling make's sort function on the list which removes |
| 9 | duplicates and stops the overflow from reaching the echo command. |
| 10 | The original sort is left to handle the the .h and .def files. |
| 11 | |
| 12 | 2021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org> |
| 13 | |
| 14 | gcc/ChangeLog: |
| 15 | |
| 16 | * Makefile.in: Fix "argument list too long" from install-plugins |
| 17 | |
| 18 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 19 | |
| 20 | Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582722.html] |
| 21 | Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=66e157188bd2f789809e17e85f917534c9381599] |
| 22 | --- |
| 23 | gcc/Makefile.in | 2 +- |
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | |
| 26 | Index: gcc-11.2.0/gcc/Makefile.in |
| 27 | =================================================================== |
| 28 | --- gcc-11.2.0.orig/gcc/Makefile.in |
| 29 | +++ gcc-11.2.0/gcc/Makefile.in |
| 30 | @@ -3678,7 +3678,7 @@ install-plugin: installdirs lang.install |
| 31 | # We keep the directory structure for files in config, common/config or |
| 32 | # c-family and .def files. All other files are flattened to a single directory. |
| 33 | $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) |
| 34 | - headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ |
| 35 | + headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ |
| 36 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ |
| 37 | for file in $$headers; do \ |
| 38 | if [ -f $$file ] ; then \ |