Some build environments and configuration options may lead to the make variable PLUGIN_HEADERS being too long to be passed as parameters to the shell `echo` command, leading to a "write error" message when making the target install-plugin.
The following patch fixes this issue by using the [Make $(sort list)][1] function instead to remove duplicates from the list of headers. There is no functional change, the value assigned to the shell variable is the same. Tested in production on x86 and armv7 cross-compilation toolchains. - The length of the headers variable goes from 80000+ chars to 7500+ Tested with make bootstrap and make check on host-x86_64-pc-linux-gnu - make bootstrap successful - make check fails even before the patch is applied WARNING: program timed out. FAIL: libgomp.c/../libgomp.c-c++-common/cancel-parallel-1.c execution test ... make[4]: *** [Makefile:479: check-DEJAGNU] Error 1 2019-04-15 Emeric Dupont <emeric.dup...@zii.aero> * Makefile.in: Use builtin sort instead of shell sort [1]: https://www.gnu.org/software/make/manual/html_node/Text-Functions.html#index-sorting-words Signed-off-by: Emeric Dupont <emeric.dup...@zii.aero> --- gcc/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index d186d71c91e..3196e774a26 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3538,7 +3538,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype # We keep the directory structure for files in config or c-family and .def # files. All other files are flattened to a single directory. $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) -headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \ +headers=$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def)); \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ for file in $$headers; do \ if [ -f $$file ] ; then \ -- 2.21.0 ________________________________ TriaGnoSys GmbH, Registergericht: München HRB 141647, Vat.: DE 813396184 Geschäftsführer: Núria Riera Díaz, Peter Lewalter ________________________________ This email and any files transmitted with it are confidential & proprietary to Zodiac Inflight Innovations. This information is intended solely for the use of the individual or entity to which it is addressed. Access or transmittal of the information contained in this e-mail, in full or in part, to any other organization or persons is not authorized.