Argument list too long
I am having some issues when trying to run quite a long compile command from a makefile.
The command is within the bounds of ARG_MAX as defined in /usr/include/linux/limits.h and will run fine if I run the command in the terminal by itself, but when it is run from the makefile I get the error: gcc/mipsel-linux-uclibc/4.4.5/cc1: execv: Argument list too long I am using: kernel: 2.6.9-34.ELsmp make: GNU Make 3.81 Any idea of where to begin with solving this issue would be much appreciated. |
this is the only thing i can think of --
is there a deep directory structure that is generating lots of long path designations? if so can you flatten the directory structure to get rid of the long path names ? |
Quote:
If you can to clear up unused environment variables may be it'll help. |
I had thought of that also, but unfortunately it's part of a very large project and at the moment changing the file structure is not at all possible. Thank you anyway.
EDIT: Valery, I only seen your response after I posted this one. I called printenv to see the list of environment variables. Even after summing the length of this along with the length of the command, I am well within the bounds of ARG_MAX. The command is 18563 characters. The environment variables 1002. Well within the 131072 bytes limit. It is however significantly longer than most of the other commands in the project. I've noticed some duplicate arguments and I will see what I can do about removing these. EDIT2: I just had a thought, do makefiles temporarily store all of their variables as environment variables? As this could definitely push it over the limit if so. |
i think you can up that 131072 to 524032
chdev -l sys0 -a ncargs=128 this should make ARG_MAX 128 * 4096 |
also if the make system is exporting messages that is uses as warnings or whatever as environmental variables.
|
Gary, I've done some research (http://www.in-ulm.de/~mascheck/various/argmax/) and it suggests the command you give is not a general linux command but for AIX.
I am apprehensive about making changes to the system if I can avoid it, as this is on a shared machine that is part of a very large project. As for your last post, I am not sure what you mean. |
Quote:
|
Quote:
According to this link: http://www.in-ulm.de/~mascheck/various/argmax/ The maximum length of arguments is set to 1/4 of the stack size. I have tried the build on two different machines. One machine works, the other does not. They both appear to have the same stack size according to ulimit -s. However they have different ARG_MAX values according to getconf ARG_MAX. But according to the link above, this is a legacy value that is no longer used in this version of linux. I am not sure which value to believe. |
Quote:
|
On the successful machine:
2.6.32.26-175.fc12.i686.PAE On the failing machine: 2.6.9-34.ELsmp Does the 2.6.9 suggest that this is prior to the changes from ARG_MAX to 1/4 of the stack? |
Quote:
|
All times are GMT -5. The time now is 04:32 AM. |