gcc -mno-cygwin needs gcc-2.95.2-mingw-extra.tar.gz

Mumit Khan khan@NanoTech.Wisc.EDU
Wed Mar 15 01:23:00 GMT 2000

On 11 Mar 2000, Kazuhiro Fujieda wrote:

> I use gcc-2.95.2-1 and binutils-19990818-1 included in the
> preview net release. I still need gcc-2.95.2-mingw-extra.tar.gz
> distributed at your site for compiling the `strace' command in
> winsup snapshots.
> Is this right ? Is there something wrong in installing gcc or
> compiling winsup snapshots ?

Apologies for the delay in responding. Life's pretty hectic right

The problem has to do with symbols from libgcc.a, which binds to
Cygwin DLL (specifically __impure_ptr that gets pulled in from
stdio in libgcc(_eh.o)).

I've sent Chris a patch that in theory should be able to work around
this issue.  However, I couldn't get sourceware CVS to respond, so
have to wait till tomorrow to check it in, unless Chris gets to it

Here's the patch:

2000-03-14  Mumit Khan  <khan@xraylith.wisc.edu>

	* Makefile.in (MINGW_CFLAGS): Add -fno-exceptions.
	* strace.cc (_impure_ptr): New global variable to make strace
	build under Cygwin gcc.

Index: Makefile.in
RCS file: /cvs/src/src/winsup/utils/Makefile.in,v
retrieving revision 1.2
diff -u -3 -p -r1.2 Makefile.in
--- Makefile.in	2000/02/28 05:08:05	1.2
+++ Makefile.in	2000/03/15 05:50:03
@@ -35,8 +35,8 @@ include $(srcdir)/../Makefile.common
+MINGW_CXXFLAGS:=$(CXXFLAGS) -fno-exceptions -mno-cygwin $(CXXFLAGS) $(MINGW_INCLUDES)
+MINGW_CFLAGS:=$(CFLAGS) -fno-exceptions -mno-cygwin $(CFLAGS) $(MINGW_INCLUDES)
Index: strace.cc
RCS file: /cvs/src/src/winsup/utils/strace.cc,v
retrieving revision 1.2
diff -u -3 -p -r1.2 strace.cc
--- strace.cc	2000/02/28 05:08:05	1.2
+++ strace.cc	2000/03/15 05:45:58
@@ -8,6 +8,14 @@
 #include <signal.h>
 #include "sys/strace.h"
+#ifndef __CYGWIN__
+/* We're building using Cygwin compiler, but in mno-cygwin mode. GCC
+   runtime library's C++ EH code unfortunately pulls in stdio, and we
+   get undefine references to __impure_ptr, and hence the following
+   hack. It should be reasonably safe however.  */
+int _impure_ptr;
 static const char *pgm;
 static int forkdebug = 0;
 static int numerror = 1;


More information about the Cygwin-developers mailing list