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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140964): 
https://lists.openembedded.org/g/openembedded-core/message/140964
Mute This Topic: https://lists.openembedded.org/mt/75804103/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to