winsup/cygwin/lib/getopt.c -mno-cygwin (solution?)

Norman Vine
Fri Sep 21 17:28:00 GMT 2001

Christopher Faylor writes:
>It just occurred to me that people who haven't been able to build
>strace.exe may have an older Makefile that does not incorporate the
>changes that I made to which add -I...mingw/include to
>the mingw_getopt.o compilation.
>I'm not sure how that could happen since my Makefile is regenerated
>automatically if the is newer but it sure sounds like
>this is the problem.
>The __argv declarations should be coming from mingw's stdlib.h.  There
>should be no way that this needs to declare this explicitly if the
>right header file is being included.

This is indeed my problem my make is picking up  stdlib.h from newlib
and not the from the mingw tree

>Could whomever is having this problem try rebuilding with CVS sources?
>      src=whereever-src/winsup
>      bld=whereever-bld/winsup
>      cd $src/cygwin/lib
>      mv getopt.c getopt.c.saf
>      cvs update
>      cd $bld/utils
>      rm Makefile, mingw_*, strace.exe
>      ./config.status
>      make strace.exe

Sure thing

Here is my configure command line
../src/configure \
--enable-shared \
--prefix=/usr \
--target=i686-pc-cygwin \
--host=i686-pc-cygwin \
--enable-haifa \
--exec-prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/sbin \

Here is my make comandline
make tooldir=/usr

$ make strace.exe
gcc -L/src/cygwin/obj/i686-pc-cygwin/winsup
-isystem /src/cygwin/src/winsup/include
-isystem /src/cygwin/src/winsup/cygwin/include
-isystem /src/cygwin/src/winsup/w32api/include
-isystem /src/cygwin/src/newlib/libc/sys/cygwin
-isystem /src/cygwin/src/newlib/libc/sys/cygwin32
-isystem /src/cygwin/obj/i686-pc-cygwin/newlib/targ-include
-isystem /src/cygwin/src/newlib/libc/include
-c -nostdinc   -g -O2 -Wall -Wwrite-strings
-I. -I/src/cygwin/src/winsup/cygwin/include
-c -o ./mingw_getopt.o -mno-cygwin
/src/cygwin/src/winsup/cygwin/lib/getopt.c: In function `_vwarnx':
/src/cygwin/src/winsup/cygwin/lib/getopt.c:114: `__argv' undeclared (first
use in this function)
/src/cygwin/src/winsup/cygwin/lib/getopt.c:114: (Each undeclared identifier
is reported only once
/src/cygwin/src/winsup/cygwin/lib/getopt.c:114: for each function it appears
make: *** [mingw_getopt.o] Error 1



More information about the Cygwin-patches mailing list