From patchwork Tue Jan 29 12:34:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libgo patch committed: Support sparc64 in lfstack.c Date: Tue, 29 Jan 2013 02:34:02 -0000 From: Rainer Orth X-Patchwork-Id: 216509 Message-Id: To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Ian Lance Taylor writes: > Looks like sparc64 broke for libgo when parallel garbage collection was > introduced. This patch is an attempt to get it working again. > Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu, not that > that proves much. Committed to mainline. I needed the following patch on top of yours to get it to compile on Solaris/SPARC. The #undefs are necessary to avoid redefinition errors. This massivly improves Solaris/SPARC testsuite results, though there are still a few common Solaris failures and a few others that might be endianess issues. Rainer diff --git a/libgo/runtime/lfstack.c b/libgo/runtime/lfstack.c --- a/libgo/runtime/lfstack.c +++ b/libgo/runtime/lfstack.c @@ -19,7 +19,10 @@ #if __SIZEOF_POINTER__ == 8 && defined(__sparc__) // SPARC64 uses all 64 bits of virtual addresses. Use low-order three -bits as ABA counter. +// bits as ABA counter. +#undef PTR_BITS +#undef CNT_MASK +#undef PTR_MASK #define PTR_BITS 0 #define CNT_MASK 7 #define PTR_MASK ((0ull-1)<<3)