Hi All,
Im facing compilation problem. The compilation gives an error of "too many arguments" since there seem to be an OS limitation of command length in all the new OS versions. Compilation in current environment is kernel dependent and is not compatible with the one I am using 2.6.9-67
I figured out a work around for the same,I have an old machine which has an kernel version(2.4.21), i am using this machine for Compilation.
The process goes like this:-
I have 2 projects which needs to be linked and then I can generate library file (desired output).
Project 1 - > Compiled & build on 2.6.9
Linked with Project 2
Project 2 compilation on same kernel throws execvp: /bin/sh: Argument list too long
Workaround as temporary fix:-
Project 1 -> Compile and build on 2.6.9
Linked with project 2
Project 2 If builds on 2.4.21 – Success -> .a file generates successfully
I don’t want additional dependency on old kernel, and wanted to understand why there is dependency on old machine, compilation doesn’t passes in 2.6.9 and its successful in 2.4.21
execvp: /bin/sh: Argument list too long - This is a common problem which actually signifies limitation of OS, and exists for solaris and other distros also.
Error that comes in all other kernel versions except 2.4.21-40:-
------------
gmake[1]: Entering directory gmake[1]: execvp: /bin/sh: Argument list too long
gmake[1]: *** Error 127
gmake[1]: Leaving directory
I was checking some other links, and came across one suggestion :-
Link for workaround on similar Lines :-
http://kbase.redhat.com/faq/docs/DOC-2504
I don’t have root access and don’t want to change anything at kernel level, what I am really interested in is - > to do something within the project itself -> probably something regarding makefiles that will make the system independent of this additional dependency of kernel 2.4.21
Actual limitation is not on command length, but on command length + environment length.
Also I read somewhere if I clean environmental variables this may solve the problem
I read this as workaround, wanted to understand what this command is doing,
env - PATH=$PATH USER=$USER HOME=$HOME make
But even this had taken me to same error point.
Some programs (like newlib or glibc) generate long argument lists to add object files to archives. The makefile can be edited to covert a single invocation of a program (say, ar) to use xargs.
Kindly post your views and suggestions .
Many thanks in advance.
Cheers
Sahil