Patchwork [1/1] gcc-cross: argument list too long when do_install

login
register
mail settings
Submitter Robert Yang
Date June 13, 2012, 8:27 a.m.
Message ID <383a2fd8ee2090cddea30dc5a825d3983780298b.1339568577.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/29783/
State New
Headers show

Comments

Robert Yang - June 13, 2012, 8:27 a.m.
There would be an "Argument list too long" error when the length of
tmpdir is longer than 190, this is caused by:

headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`

The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
it, use the $(sort list) of GNU make which can handle the too long list
would fix the problem, the header would be short enough after sorted.
The "tr ' ' '\012'" was used for translating the space to "\n", the
$(sort list) doesn't need this.

This doesn't impact the output, so it doesn't need the PR bump.

[YOCTO #2591]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-common.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Khem Raj - June 13, 2012, 2:23 p.m.
On Wed, Jun 13, 2012 at 1:27 AM, Robert Yang <liezhi.yang@windriver.com> wrote:
> There would be an "Argument list too long" error when the length of
> tmpdir is longer than 190, this is caused by:
>
> headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
>
> The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
> it, use the $(sort list) of GNU make which can handle the too long list
> would fix the problem, the header would be short enough after sorted.
> The "tr ' ' '\012'" was used for translating the space to "\n", the
> $(sort list) doesn't need this.
>
> This doesn't impact the output, so it doesn't need the PR bump.
>
> [YOCTO #2591]
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/recipes-devtools/gcc/gcc-common.inc |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
> index 45828bb..c3b79ab 100644
> --- a/meta/recipes-devtools/gcc/gcc-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-common.inc
> @@ -102,6 +102,10 @@ do_headerfix () {
>        #
>        sed -i ${S}/gcc/config/*/linux*.h -e \
>                's#\(GLIBC_DYNAMIC_LINKER[^ ]*\) \( *"/lib.*\)/\(.*\)#\1 SYSTEMLIBS_DIR "\3#'
> +
> +       # Fix the "Argument list too long" error
> +       sed -i ${S}/gcc/Makefile.in -e \
> +               's#headers=`echo $(PLUGIN_HEADERS) | tr .*012.* | sort -u`#headers=\"$(sort $(PLUGIN_HEADERS))\"#'
>  }
>

can it be created as a patch? gcc recipes are getting complex already

>  addtask headerfix after do_unpack before do_patch
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 45828bb..c3b79ab 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -102,6 +102,10 @@  do_headerfix () {
 	#
 	sed -i ${S}/gcc/config/*/linux*.h -e \
 		's#\(GLIBC_DYNAMIC_LINKER[^ ]*\) \( *"/lib.*\)/\(.*\)#\1 SYSTEMLIBS_DIR "\3#'
+
+	# Fix the "Argument list too long" error
+	sed -i ${S}/gcc/Makefile.in -e \
+		's#headers=`echo $(PLUGIN_HEADERS) | tr .*012.* | sort -u`#headers=\"$(sort $(PLUGIN_HEADERS))\"#'
 }
 
 addtask headerfix after do_unpack before do_patch