LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2009, 11:49 PM   #1
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Rep: Reputation: 15
execvp: /bin/sh: Argument list too long - Compilation Error


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. The compilation is kernel dependent and is not compatible with my 2.6.9-67.

I have an old machine which has an kernel version(2.4.21), i am using this machine for Compilation.

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
-----------

Can you please suggest some solution for this. If something can be done with the code, which can solve this problem , or if some patch is available to fix this.


Link for workaround on similar Lines :-
http://kbase.redhat.com/faq/docs/DOC-2504


Many thanks in advance.

Cheers
Sahil
 
Old 05-03-2009, 12:16 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by sahil.jammu View Post
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. The compilation is kernel dependent and is not compatible with my 2.6.9-67.

I have an old machine which has an kernel version(2.4.21), i am using this machine for Compilation.

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
-----------

Can you please suggest some solution for this. If something can be done with the code, which can solve this problem , or if some patch is available to fix this.


Link for workaround on similar Lines :-
http://kbase.redhat.com/faq/docs/DOC-2504


Many thanks in advance.

Cheers
Sahil
Actual limitation is not on command length, but on command length + environment length.

So if you clean some of your environment variable it may help
 
Old 05-03-2009, 06:38 AM   #3
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
Hi,

Like you said, Actual limitation is not on command length, but on command length + environment length , the default space is 131K , which equals 128K argument and enviornment 3K , which is defined in limits.h.

Can you suggest some work around, how to clean the environment variables to fix this as i tried doing the clean using gmake clean before starting the compilation...!!!
 
Old 05-03-2009, 07:40 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by sahil.jammu View Post
Hi,

Like you said, Actual limitation is not on command length, but on command length + environment length , the default space is 131K , which equals 128K argument and enviornment 3K , which is defined in limits.h.

Can you suggest some work around, how to clean the environment variables to fix this as i tried doing the clean using gmake clean before starting the compilation...!!!
You can try
Code:
env - PATH=$PATH USER=$USER HOME=$HOME make
 
Old 05-03-2009, 08:15 AM   #5
sahil.jammu
Member
 
Registered: Jun 2008
Distribution: Ubuntu
Posts: 83

Original Poster
Rep: Reputation: 15
http://kbase.redhat.com/faq/docs/DOC-2504

Just checked this post. Find it Useful on similar lines..!!
 
Old 05-03-2009, 09:30 PM   #6
eager
Member
 
Registered: Aug 2004
Location: Palo Alto, CA
Distribution: Fedora 8/9, Ubuntu
Posts: 50

Rep: Reputation: 18
You don't indicate what program you are trying to build.

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.
 
Old 03-31-2020, 08:17 AM   #7
allen_yuan
LQ Newbie
 
Registered: Mar 2020
Posts: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by sahil.jammu View Post
http://kbase.redhat.com/faq/docs/DOC-2504

Just checked this post. Find it Useful on similar lines..!!
I tried but not work...........
 
Old 03-31-2020, 08:32 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by allen_yuan View Post
I tried but not work...........
You have re-opened a thread that had been closed for **ELEVEN YEARS**...not surprised at all that the advice in here doesn't work now. And if you want help you need to go back to your OTHER thread about the same issue.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
-bash: /bin/: Argument list too long zeeshan673 Linux - General 4 02-22-2007 10:25 AM
Combines 16000 files into 1 single file > error tb: /bin/cat: Argument list too long guanyu Linux - General 4 02-09-2007 12:33 AM
bash: /bin/rm: Argument list too long? FiveFlat Linux - General 5 08-11-2004 11:29 PM
-bash: /bin/mv: Argument list too long balanagireddy Linux - General 2 07-27-2004 11:19 PM
/bin/rm: Argument list too long dragon49 Linux - Software 1 09-02-2003 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration