[OE-core] [PATCH 1/1] sanity.bbclass: check TMPDIR is not too long

Phil Blundell philb at gnu.org
Tue May 8 07:14:31 UTC 2012


On Tue, 2012-05-08 at 10:50 +0800, Robert Yang wrote:
> When the length of TMPDIR is longer than a threshold, there would be an
> "Argument list too long" error when building gcc-cross, this is the
> error from the exec(), the maximum length of argument is defined in
> /usr/include/linux/limits.h:
> 
>   #define ARG_MAX       131072    /* # bytes of args + environ for exec() */
> 
> It's hard to determine the threshold of the TMPDIR, here is the
> experimental value:
> len(TMPDIR) = 182	Success
> len(TMPDIR) = 192	Failed
> 
> So set the maximum length of TMPDIR to 180 seems proper.

It seems a bit lame for paths to be restricted to such a short length.
How does a 192-byte TMPDIR end up causing more than 131072 bytes of
arguments and environment?  Can anything be done to reduce that?  For
example, can you use "gcc @..." to remove common options from the
command line?  Can you eliminate garbage from the environment that
doesn't need to be there?

p.






More information about the Openembedded-core mailing list