gcc-cross: Argument list too long
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
Quoted 23 lines · Robert Yang
There would be an error when building gcc-cross in the
do_installstage if the TMPDIR's length is more than 200 characters:make[1]: execvp:
/bin/sh: Argument list too longThis 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_installof 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 ofPATH_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