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: execvp error:cygwin+make+busybox


On Tue, May 03, 2005 at 10:39:13AM +1000, John Williams wrote:
>Attempting to cross-compile Busybox 1.00 under Cygwin (1.5.16-1) I am 
>hitting an error similar to one previously reported on the Cygwin list 
>(Jan 05):
>
>http://www.cygwin.com/ml/cygwin/2005-01/msg00657.html
>
>No resolution was posted to the list at that time.
>
>The busybox Makefile attempts to run the host CC (gcc in this case) to 
>build some setup/config tools, as well as spawning a shell script to do 
>a bit of preparatory work.  This is before any cross-compiling begins.
>
>Make reports the following error:
>
>gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep 
>/cygdrive/e/cygwin-uclinux/uClinux-dist/user/busybox/scripts/mkdep.c
>make[3]: execvp: gcc: Invalid argument
>make[3]: *** [scripts/mkdep] Error 127
>
>The problem occurs with Make versions 3.79.1 and 3.80 (haven't tested 
>any earlier versions)
>
>The Makefile fragment which fails looks like this:
>
>scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
>        $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
>
>HOSTCC and HOSTCFLAGS can be deduced from above output, but there's 
>nothing exotic in there.
>
>Another fragment which fails is this:
>
>.config.mkconfig: $(ROOTDIR)/config/.config
>        sh ./mkconfig > .config.tmp
>
>This fragment fails with:
>make[3]: execvp: sh: Invalid argument
>
>If executed directly from the commandline, these commands complete fine 
>- it's only when spawning from within the Makefile.
>
>cygcheck output is attached.
>
>Any insights into the nature and possible solution of this problem would 
>be greatly appreciated.

IIRC, I also had this problem on Cygwin until I deleted the
.EXPORT_ALL_VARIABLES from Rules.mak.  I have a specialized build
environment so it is possible that there are other things required to
get things working after that, but this was the culprit which caused
these problems.

Another work around is to do this:

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

Mounting your /bin directory with the -X flag will make cygwin bypass
the windows mechanism for passing environment variables to subprocesses.
The errors that you are seeing are coming from environment table
overflow in in make due to every single Makefile variable being forced
into the environment.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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