Subject: Re: Boehm's Garbage Collector ?
From: [email-masked] (Fergus Henderson)

24 Oct 1996 16:43:01 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]> <[email-masked]>
Original-To: [email-masked]
Original-Cc: [email-masked], [email-masked]
Original-Sender: [email-masked]

>Ian Searle wrote:
>> 
>> I was wondering if anyone has built Boehm's garbage collector with
>> the gnu-win32 gcc ?

Yes, I have.  Here's the diff I sent to Hans.
This doesn't solve all the problems, just the ones
I needed to get my application working. In particular,
you need to set GC_stackbottom explicitly from main().
Also, there is a problem that SIG_FILL is missing.

===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/config.h,v
retrieving revision 1.5
diff -b -u -r1.5 config.h
--- config.h	1996/03/05 11:06:21	1.5
+++ config.h	1996/05/08 07:25:08
@@ -188,6 +188,11 @@
 #   define DJGPP  /* MSDOS running the DJGPP port of GCC */
 #   define mach_type_known
 # endif
+# if defined(__CYGWIN32__)
+#   define I386
+#   define CYGWIN32
+#   define mach_type_known
+# endif
 # if defined(__BORLANDC__)
 #   define I386
 #   define MSWIN32
@@ -492,6 +497,13 @@
 #	define STACKBOTTOM ((ptr_t)0xc0000000)
 #	define MPROTECT_VDB
 #   endif
+#   ifdef CYGWIN32
+#       define OS_TYPE "CYGWIN32"
+        extern int _bss_start__;
+#       define DATASTART       ((ptr_t)&_bss_start__)
+        extern int _data_end__;
+#       define DATAEND          ((ptr_t)&_data_end__)
+#   endif
 #   ifdef OS2
 #	define OS_TYPE "OS2"
  	    	/* STACKBOTTOM and DATASTART are handled specially in 	*/
Index: boehm_gc/mach_dep.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/mach_dep.c,v
retrieving revision 1.4
diff -b -u -r1.4 mach_dep.c
--- mach_dep.c	1996/03/05 11:06:45	1.4
+++ mach_dep.c	1996/05/05 10:04:30
@@ -168,7 +168,7 @@
 #	endif	/* __MWERKS__ */
 #   endif	/* MACOS */
 
-#       if defined(I386) &&!defined(OS2) &&!defined(SVR4) &&!defined(MSWIN32) && !defined(SCO) && (!defined(LINUX) || !defined(__ELF__))
+#       if defined(I386) &&!defined(OS2) &&!defined(SVR4) && !defined(SCO) && (!defined(LINUX) || !defined(__ELF__))
 	/* I386 code, generic code does not appear to work */
 	/* It does appear to work under OS2, and asms dont */
 	  asm("pushl %eax");  asm("call _GC_push_one"); asm("addl $4,%esp");
@@ -191,7 +191,7 @@
 	  asm("pushl %ebx");  asm("call GC_push_one"); asm("addl $4,%esp");
 #	endif
 
-#       if defined(I386) && defined(MSWIN32)
+#       if defined(I386) && defined(MSWIN32) && 0
 	/* I386 code, Microsoft variant		*/
 	  __asm  push eax
 	  __asm  call GC_push_one
Index: boehm_gc/os_dep.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/os_dep.c,v
retrieving revision 1.5
diff -b -u -r1.5 os_dep.c
--- os_dep.c	1996/03/05 11:07:02	1.5
+++ os_dep.c	1996/05/05 10:41:42
@@ -227,7 +227,9 @@
 void GC_disable_signals()
 {
     if (!mask_initialized) {
+#if 0
     	SIG_FILL(new_mask);
+#endif
 
 	SIG_DEL(new_mask, SIGSEGV);
 	SIG_DEL(new_mask, SIGILL);
Index: boehm_gc/test.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/test.c,v
retrieving revision 1.4
diff -b -u -r1.4 test.c
--- test.c	1996/03/05 11:07:12	1.4
+++ test.c	1996/05/08 07:02:40
@@ -851,6 +851,9 @@
   int main()
 #endif
 {
+    char dummy;
+    extern char*GC_stackbottom;
+    GC_stackbottom = &dummy;
     n_tests = 0;
     
 #   if defined(MACOS)

--
Fergus Henderson <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".