Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 2 | Subject: [PATCH 2/5] gcc: Fix "argument list too long" from install-plugins |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 3 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 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. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 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. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 11 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 12 | 2021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 14 | gcc/ChangeLog: |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 16 | * Makefile.in: Fix "argument list too long" from install-plugins |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 17 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 18 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 19 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 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] |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 22 | --- |
| 23 | gcc/Makefile.in | 2 +- |
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 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 |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 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. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) |
| 34 | - headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 35 | + headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 36 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ |
| 37 | for file in $$headers; do \ |
| 38 | if [ -f $$file ] ; then \ |