blob: 9f9f8cc85613417bdb372e6c9f04e11a389bec29 [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001From 768e9075e88d811b00207d991123438bb996e4ea Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:26:37 +0400
4Subject: [PATCH] gcc: Fix argument list too long error.
5
6There would be an "Argument list too long" error when the
7build directory is longer than 200, this is caused by:
8
9headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
10
11The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
12it, use the $(sort list) of GNU make which can handle the too long list
13would fix the problem, the header would be short enough after sorted.
14The "tr ' ' '\012'" was used for translating the space to "\n", the
15$(sort list) doesn't need this.
16
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19
20RP: gcc then added *.h and *.def additions to this list, breaking the original
21fix. Add the sort to the original gcc code, leaving the tr+sort to fix the original
22issue but include the new files too as reported by Zhuang <qiuguang.zqg@alibaba-inc.com>
23
24Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=66e157188bd2f789809e17e85f917534c9381599]
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26---
27 gcc/Makefile.in | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30diff --git a/gcc/Makefile.in b/gcc/Makefile.in
31index 95962ae37b6..d1d4512bba3 100644
32--- a/gcc/Makefile.in
33+++ b/gcc/Makefile.in
34@@ -3671,7 +3671,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
35 # We keep the directory structure for files in config, common/config or
36 # c-family and .def files. All other files are flattened to a single directory.
37 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
38- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
39+ headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
40 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
41 for file in $$headers; do \
42 if [ -f $$file ] ; then \