]> code.ossystems Code Review - openembedded-core.git/commit
gcc: Fix mangled patch
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Jan 2021 07:49:22 +0000 (15:49 +0800)
committerSteve Sakoman <steve@sakoman.com>
Wed, 6 Jan 2021 14:42:53 +0000 (04:42 -1000)
commitcfa92a4d57f49188ca7b568e2003e4a11526fc95
tree0d3579780b5ae77828a6f60aa3a3bc50a92a52f4
parent0c5151a7ec6ac0aaed1bc56ebb89f17442683072
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)

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>
meta/recipes-devtools/gcc/gcc-9.3/0012-gcc-Fix-argument-list-too-long-error.patch