[Gc] gc6.5 patch for Darwin/xlc

Dan Bonachea bonachea at cs.berkeley.edu
Mon May 23 00:10:53 PDT 2005

gc6.5 needs the following patch to work on Darwin with the IBM XLC compiler.

The Makefile.am change disables gcc-specific assembler options which cause xlc 
to barf at compilation time.

The configure.in change forces -DDARWIN_DONT_PARSE_STACK for Darwin/xlc 
(enabling Andy's stack walk workaround), because the stack walking code used 
on gcc is utterly broken for xlc (consistent bus fault on gctest, and any 
other program using the collector).

Once the patch is applied, xlc/darwin passes gctest and the collector appears 
to be fully functional.

- Dan

diff -r -Naur gc6.5-orig/Makefile.am gc6.5-new/Makefile.am
--- gc6.5-orig/Makefile.am      Mon May 16 15:11:08 2005
+++ gc6.5-new/Makefile.am       Sun May 22 23:59:04 2005
@@ -105,10 +105,18 @@
  include/gc_mark.h @addincludes@

  ## FIXME: we shouldn't have to do this, but automake forces us to.
+  ## XLC neither requires nor tolerates the unnecessary assembler goop
+  ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
+  ## these.
+  ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
  ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
  ## these.
-       $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $<
+       $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
diff -r -Naur gc6.5-orig/configure.in gc6.5-new/configure.in
--- gc6.5-orig/configure.in     Wed Feb  9 11:35:23 2005
+++ gc6.5-new/configure.in      Sun May 22 23:59:04 2005
@@ -184,6 +184,19 @@
  AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)

+ #ifndef __xlC__
+ # error
+ #endif
+], [compiler_xlc=yes], [compiler_xlc=no])
+AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
+if test $compiler_xlc = yes -a $powerpc_darwin = true; then
+  # the darwin stack-frame-walking code is completely broken on xlc
  # We never want libdl on darwin. It is a fake libdl that just ends up making
  # dyld calls anyway
  case "$host" in

More information about the Gc mailing list