[OE-core] gcc-cross: Argument list too long

Richard Purdie richard.purdie at linuxfoundation.org
Fri Apr 13 08:31:19 UTC 2012


On Fri, 2012-04-13 at 14:45 +0800, Robert Yang wrote:
> There would be an error when building gcc-cross in the do_install stage
> if the TMPDIR's length is more than 200 characters:
> 
> make[1]: execvp: /bin/sh: Argument list too long
> 
> This is because of the limit of /usr/include/linux/limits.h:
> 
> $ grep PATH_MAX /usr/include/linux/limits.h
> #define PATH_MAX        4096    /* # chars in a path name including nul */
> 
> I don't think it's worth to fix the do_install of gcc-cross, but it would
> be good if we can add a check in oe-init-build-env or meta/classes
> /sanity.bbclass to check wether the TMPDIR(or build directory) is longer than a 
> reasonable vaule, e.g., 1/16th or 1/32th of PATH_MAX? If you are OK with this,
> I'd like to work on it.
> 
> To reproduce the error:
> 
> $ cd /path/to/workdir/
> $ for i in `seq 20`; do mkdir _23_5_78_; cd _23_5_78_; done
> $ source /path/to/poky/oe-init-build-env
> $ bitbake gcc-cross
> 
> Then the error comes.
> 
> $ pwd | wc -c
> 224

I think sanity.bbclass would be a good place to have a one time check of
the length of TMPDIR...

Cheers,

Richard





More information about the Openembedded-core mailing list