summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-06 15:49:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-13 08:57:57 +0000
commitcbd458957b881873d83c97dd7920394f5f42a427 (patch)
tree6e77fabdcebfbde144ea0516dabc879a86a1e589 /meta
parent1af84e8be6e665a660484f21da5a00167b669994 (diff)
downloadpoky-cbd458957b881873d83c97dd7920394f5f42a427.tar.gz
gcc: Fix mangled patch
To quote Zhuang <qiuguang.zqg@alibaba-inc.com>: """ A few days ago, I tried to compile a gcc plugin with the toolchain from poky sdk. It failed with errors about missing header files such as backend.h etc. After investigation, I found that the problem was brought by a gcc patch: 0012-gcc-Fix-argument-list-too-long-error.patch (which is considered derived from the original patch) - headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ + headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \ It changes the commands of install-plugin, making the sorting taken effect before the shell globs. Thus results in the header files under gcc $(srcdir) being not installed. By checking log.do_install, we can find that the `headers=' statement to run is incorrect and will not work as expected: headers="$(cd *.def) *.h ../../../../../../../work-shared/gcc-10.1.0-r0/gcc-10.1.0/gcc/../include/ansidecl.h ... As the patch says, "The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle it, ..." my suggestion is that we can simply take care of PLUGIN_HEADERS using the original proposed sort. """ This fixes the gcc patch as proposed as it does appear its been broken over time. (From OE-Core rev: dce28d8ac7fbae487cb6674b91fe2b574036b26d) (From OE-Core rev: cfa92a4d57f49188ca7b568e2003e4a11526fc95) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 94eb5724b111cf3409219be3b169af79858eab7b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch
index 9d98878096..f0b79ee145 100644
--- a/meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch
+++ b/meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch
@@ -17,6 +17,10 @@ $(sort list) doesn't need this.
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18Signed-off-by: Khem Raj <raj.khem@gmail.com> 18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 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
20Upstream-Status: Pending 24Upstream-Status: Pending
21--- 25---
22 gcc/Makefile.in | 2 +- 26 gcc/Makefile.in | 2 +-
@@ -31,7 +35,7 @@ index fef6c4c61e3..57cf7804f0a 100644
31 # files. All other files are flattened to a single directory. 35 # files. All other files are flattened to a single directory.
32 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) 36 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
33- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ 37- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
34+ headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \ 38+ headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
35 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ 39 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
36 for file in $$headers; do \ 40 for file in $$headers; do \
37 if [ -f $$file ] ; then \ 41 if [ -f $$file ] ; then \