mingw using wrong errno definition

Chris Faylor cgf@cygnus.com
Wed Apr 5 07:59:00 GMT 2000

On Wed, Apr 05, 2000 at 12:15:00AM -0700, Ron Parker wrote:
>In an attempt to build the cinstall source without using MSVC, I have
>made the following minor changes to my local copy of the winsup source
>from CVS. One corrects an obvious typo and the other was so I could
>configure and build everything in one pass from the main directory
>including the cinstall code.
>Index: winsup/configure.in
>RCS file: /cvs/src/src/winsup/configure.in,v
>retrieving revision
>diff -r1.1.1.1 configure.in
>< SUBDIRS="cygwin w32api mingw utils doc"
>>SUBDIRS="cygwin w32api mingw utils doc cinstall"

Looks good.  Go ahead and check this in.

>Index: winsup/cinstall/Makefile.in
>RCS file: /cvs/src/src/winsup/cinstall/Makefile.in,v
>retrieving revision 1.2
>diff -r1.2 Makefile.in
>< zlib/zlibcygw.a: zlib/Makefile
>>zlib/libzcygw.a: zlib/Makefile

I don't get this one.  My version of Makefile.in doesn't have a blank line
before the "zlib" here.  I've changed this to $(ZLIB) anyway since that
is more consistent.

>gcc -o setup.exe error.o memory.o setup.o strarry.o cinstall.o -g -O2
>-mno-cygwin zlib/libzcygw.a -lole32 -lwininet -lnetapi32 -ladvapi32
>zlib/libzcygw.a(gzio.o): In function `gz_open':
>undefined reference to `__errno'
>zlib/libzcygw.a(gzio.o): In function `get_byte':
>undefined reference to `__errno'
>zlib/libzcygw.a(gzio.o): In function `destroy':
>undefined reference to `__errno'
>zlib/libzcygw.a(gzio.o): In function `gzread':
>undefined reference to `__errno'
>zlib/libzcygw.a(gzio.o): In function `gzerror':
>undefined reference to `__errno'
>collect2: ld returned 1 exit status
>gcc: file path prefix
>`/home/rdparker/cygwin/obj/i686-pc-cygwin/winsup/mingw/' never used
>make: *** [setup.exe] Error 1
>It appears that despite the "-mno-cygwin
>-I../../../../src/winsup/mingw/include" switches to gcc, it is still
>picking up the standard cygwin definition of errno. I am too tired to
>have a quick solution to this and I am not sure I would know the right
>one if I were completely awake. Thought I might luck out and fine an
>answer in my mailbox in the morning. :^)

I saw this at one point when I was building cinstall.  I thought it came
from running make in the zlib directory rather than letting it be handled
by the cinstall Makefile.  I didn't get around to changing the zlib Makefile
to correctly set all of the includes so I used the tried-and-true devo technique
of relying on the fact that it was being run from a higher-level directory.

Can you try doing a "make clean all" in the cinstall directory and see if that
"fixes" things?


More information about the Cygwin-developers mailing list