Mail Archives: cygwin-developers/2000/03/15/04:43:54
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
now.
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
first.
Here's the patch:
2000-03-14 Mumit Khan <khan AT xraylith DOT wisc DOT 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_INCLUDES:=-I$(updir)/mingw/include
-MINGW_CXXFLAGS:=$(CXXFLAGS) -mno-cygwin $(CXXFLAGS) $(MINGW_INCLUDES)
-MINGW_CFLAGS:=$(CFLAGS) -mno-cygwin $(CFLAGS) $(MINGW_INCLUDES)
+MINGW_CXXFLAGS:=$(CXXFLAGS) -fno-exceptions -mno-cygwin $(CXXFLAGS) $(MINGW_INCLUDES)
+MINGW_CFLAGS:=$(CFLAGS) -fno-exceptions -mno-cygwin $(CFLAGS) $(MINGW_INCLUDES)
libcygwin:=$(cygwin_build)/libcygwin.a
libuser32:=$(w32api_lib)/libuser32.a
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;
+#endif
+
static const char *pgm;
static int forkdebug = 0;
static int numerror = 1;
Regards,
Mumit
- Raw text -