[Gc] MacOSX/PowerPC patch

Boehm, Hans hans.boehm at hp.com
Fri Apr 24 17:02:33 PDT 2009


Mark Sibly pointed out that capturing the register state with __builtin_unwind_init
didn't seem to be reliable on MacOSX 10.3.9 on PowerPC.  He suggested a more general patch for all POWERPC platforms.  In the absence of more details, I'm inclined to commit something like the following:

RCS file: /cvsroot/bdwgc/bdwgc/mach_dep.c,v
retrieving revision 1.10
diff -u -r1.10 mach_dep.c
--- mach_dep.c	27 Oct 2008 22:55:49 -0000	1.10
+++ mach_dep.c	24 Apr 2009 23:56:00 -0000
@@ -199,10 +199,13 @@
           GC_save_regs_ret_val = GC_save_regs_in_stack();
         }
 #     endif /* register windows. */
-#   elif defined(HAVE_BUILTIN_UNWIND_INIT)
+#   elif defined(HAVE_BUILTIN_UNWIND_INIT) && \
+ 	 !(defined(POWERPC) && defined(DARWIN))
       /* This was suggested by Richard Henderson as the way to	*/
       /* force callee-save registers and register windows onto	*/
       /* the stack.						*/
+      /* Mark Sibly points out that this doesn't seem to work	*/
+      /* on MacOS 10.3.9/PowerPC.				*/
       __builtin_unwind_init();
 #   else /* !HAVE_BUILTIN_UNWIND_INIT && !UNIX_LIKE  */
          /* && !HAVE_PUSH_REGS			     */

(Tested only on a platform for which it doesn't matter.)

Opinions?  Insights?

Hans


More information about the Gc mailing list