This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Solution, possible FAQ entry: make problem: execvp: /bin/sh: Illegal Argument

On Sun, May 08, 2005 at 08:02:17PM -0400, Igor Pechtchanski wrote:
>On Sun, 8 May 2005, Christopher Faylor wrote:
>> On Sun, May 08, 2005 at 04:11:08PM -0400, Igor Pechtchanski wrote:
>> >On Sun, 8 May 2005, Joshua Daniel Franklin wrote:
>> >
>> >> > >On 5/6/05, J?rgen Havsberg Seland wrote:
>> >> > >> This problem is (often) due to the command-line being to long for the
>> >> > >> windows execution model. To circumvent this, mount the path of the
>> >> > >> executable using the -X switch. For instance, use
>> >> > >
>> >> > On Sat, May 07, 2005 at 05:11:39PM -0700, Joshua Daniel Franklin wrote:
>> >> > >I don't mind adding an FAQ, it looks like it's been asked few times. Any
>> >> > >problem with replacing this ancient entry about MAKE_MODE (which is
>> >> > >covered in the User's Guide)?
>> >> > >
>> >> > >
>> >> >
>> >> On 5/7/05, Christopher Faylor wrote:
>> >> > Fine with me.
>> >>
>> >> Updated with the following text (thanks, J?rgen):
>> >>
>> >> Errors of `make: execvp: /bin/sh: Illegal Argument' or `make: execvp:
>> >> /bin/sh: Argument list too long' are often caused by the command-line
>> >> being to long for the Windows execution model. To circumvent this,
>> >> mount the path of the executable using the -X switch to enable cygexec
>> >> for all executables in that folder; you will also need to exclude
>> >> non-cygwin executables with the -x switch. Enabling cygexec causes
>> >> cygwin executables to talk directly to one another, which increases
>> >> the command-line limit. To enable cygexec for `/bin' and `/usr/bin',
>> >> you can use these commands in a batch file:
>> >>
>> >> mount -X -b -f c:\cygwin\bin /bin
>> >> mount -X -b -f c:\cygwin\bin /usr/bin
>> >> mount -x -b -f c:\cygwin\bin\strace.exe /usr/bin/strace.exe
>> >> mount -x -b -f c:\cygwin\bin\strace.exe /bin/strace.exe
>> >> mount -x -b -f c:\cygwin\bin\cygcheck.exe /usr/bin/cygcheck.exe
>> >> mount -x -b -f c:\cygwin\bin\cygcheck.exe /bin/cygcheck.exe
>> >>
>> >> Note that you must specifically exclude strace and cygcheck, which are
>> >> not linked to the Cygwin DLL.
>> >
>> >Unless I'm mistaken, you'll also need to mention that invoking
>> >/bin/cygcheck and /bin/strace (and /usr/bin/cygcheck, and /usr/bin/strace)
>> >won't work with the above -- you'll need to also add
>> >
>> >mount -x -b -f c:\cygwin\bin\strace.exe /usr/bin/strace
>> >mount -x -b -f c:\cygwin\bin\strace.exe /bin/strace
>> >mount -x -b -f c:\cygwin\bin\cygcheck.exe /usr/bin/cygcheck
>> >mount -x -b -f c:\cygwin\bin\cygcheck.exe /bin/cygcheck
>> >
>> >to be able to omit the .exe extension.
>> Rather than theorize about what's needed, why not actually *try it*?
>> I don't know which of the above is needed but I doubt that all of
>> them are.
>Well, I don't know of an easy way of testing whether the cygexec
>functionality works, but I did try mounting /bin/cygcheck under another
>name, and referring to it via cygcheck.exe didn't work (and vice versa).
>Thus I concluded that mounting both the .exe version and the no-extension
>version is needed.  Multiply that by all the various paths (/usr/bin vs.
>/bin), and that gives 4 mounts for cygcheck (and 4 for strace).
>Does the above make sense?

Unfortunately, yes.  I thought that since exec() always tacks on a .exe
to the program name, this might be enough to avoid the necessity of
mounting cygcheck/strace in multiple ways.

Shouldn't we be able to just mount the */bin variant which is used by
default, though?  Is that /usr/bin?  That would catch the most common
cases without using up precious mount table slots.  It would not catch
the case of someone typing /bin/cygcheck but I don't think that it's
common for people to type that.

Ultimately, I just have to make strace and cygcheck understand the cygwin
arguments and environment variables.  Then we won't need this.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]