Skip to contentSkip to conversation

gcc-cross: Argument list too long

DISCUSSION Robert Yang 2 participants 2 messages Apr 13, 2012

lore
Share & tools
lore
#0 lore raw

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
Signature · 3 lines
Thanks

Robert
#1 lore raw
Quoted 23 lines · Robert Yang

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
Quoted 4 lines

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