All of lore.kernel.org
 help / color / mirror / Atom feed
* recipes-devtools/gcc: gcc-Fix-argument-list-too-long-error.patch is buggy
@ 2020-07-26 15:20 qiuguang.zqg
  2020-07-29 12:55 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: qiuguang.zqg @ 2020-07-26 15:20 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]

Hello,

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 ( https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/gcc/gcc-10.1/0012-gcc-Fix-argument-list-too-long-error.patch ) (which is considered derived from the original patch ( https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/gcc/gcc-4.7/gcc-argument-list-too-long.patch?h=yocto-1.4.1 ) )

- 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 :

- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
+ headers= `echo $(sort $(PLUGIN_HEADERS) ) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \

Thanks,
Zhuang

[-- Attachment #2: Type: text/html, Size: 2314 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [OE-core] recipes-devtools/gcc: gcc-Fix-argument-list-too-long-error.patch is buggy
  2020-07-26 15:20 recipes-devtools/gcc: gcc-Fix-argument-list-too-long-error.patch is buggy qiuguang.zqg
@ 2020-07-29 12:55 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2020-07-29 12:55 UTC (permalink / raw)
  To: qiuguang.zqg, openembedded-core

On Sun, 2020-07-26 at 08:20 -0700, qiuguang.zqg@alibaba-inc.com wrote:
> 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:
> 
> - headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
> + headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \

Thanks for the report, I've submitted and later merged a patch to fix it.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-29 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 15:20 recipes-devtools/gcc: gcc-Fix-argument-list-too-long-error.patch is buggy qiuguang.zqg
2020-07-29 12:55 ` [OE-core] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.