From patchwork Fri Dec 2 19:46:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Sherrill X-Patchwork-Id: 128947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 32B89B6F75 for ; Sat, 3 Dec 2011 06:47:13 +1100 (EST) Received: (qmail 2317 invoked by alias); 2 Dec 2011 19:47:11 -0000 Received: (qmail 2301 invoked by uid 22791); 2 Dec 2011 19:47:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from oarmail.oarcorp.com (HELO OARmail.OARCORP.com) (67.63.146.244) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Dec 2011 19:46:32 +0000 Received: from iceland.oarcorp.com (192.168.1.171) by OARmail.OARCORP.com (192.168.2.2) with Microsoft SMTP Server (TLS) id 8.1.436.0; Fri, 2 Dec 2011 13:46:31 -0600 Message-ID: <4ED92B17.9090404@oarcorp.com> Date: Fri, 2 Dec 2011 13:46:31 -0600 From: Joel Sherrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" , Ian Lance Taylor Subject: RTEMS Go Patch Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, This addresses all of the Go compilation issues on the head except one. Ian.. Is this OK to commit? Or do you have suggestions on how to make it more general? Thanks. 2011-12-02 Joel Sherrill * runtime/go-signal.c: Add conditional on SIGPROF. * runtime/mem_posix_memalign.c: Add USED directives. * libgo/go/syscall/wait.c: Conditionalize on WIFxxx macros and SIGxxx being defined. Index: libgo/runtime/go-signal.c =================================================================== --- libgo/runtime/go-signal.c (revision 181924) +++ libgo/runtime/go-signal.c (working copy) @@ -122,12 +122,14 @@ const char *msg; int i; +#ifdef SIGPROF if (sig == SIGPROF) { /* FIXME. */ runtime_sigprof (0, 0, nil, nil); return; } +#endif /* FIXME: Should check siginfo for more information when available. */ @@ -257,6 +259,7 @@ void runtime_resetcpuprofiler(int32 hz) { +#ifdef SIGPROF struct itimerval it; struct sigaction sa; int i; @@ -289,6 +292,7 @@ i = setitimer (ITIMER_PROF, &it, NULL); __go_assert (i == 0); } +#endif runtime_m()->profilehz = hz; } Index: libgo/runtime/mem_posix_memalign.c =================================================================== --- libgo/runtime/mem_posix_memalign.c (revision 181924) +++ libgo/runtime/mem_posix_memalign.c (working copy) @@ -36,10 +36,13 @@ void* runtime_SysReserve(void *v, uintptr n) { + USED(v); return runtime_SysAlloc(n); } void runtime_SysMap(void *v, uintptr n) { + USED(v); + USED(n); } Index: libgo/go/syscall/wait.c =================================================================== --- libgo/go/syscall/wait.c (revision 181924) +++ libgo/go/syscall/wait.c (working copy) @@ -12,6 +12,7 @@ #include #include +#include "runtime.h" extern _Bool Exited (uint32_t *w) __asm__ ("libgo_syscall.syscall.Exited.N32_libgo_syscall.syscall.WaitStatus"); @@ -37,7 +38,12 @@ _Bool Stopped (uint32_t *w) { +#ifndef WIFSTOPPED + USED(w); + return 0; +#else return WIFSTOPPED (*w) != 0; +#endif } extern _Bool Continued (uint32_t *w) @@ -46,7 +52,12 @@ _Bool Continued (uint32_t *w) { +#ifndef WIFCONTINUED + USED(w); + return 0; +#else return WIFCONTINUED (*w) != 0; +#endif } extern _Bool CoreDump (uint32_t *w) @@ -55,7 +66,12 @@ _Bool CoreDump (uint32_t *w) { +#ifndef WCOREDUMP + USED(w); + return 0; +#else return WCOREDUMP (*w) != 0; +#endif } extern int ExitStatus (uint32_t *w) @@ -95,9 +111,10 @@ __asm__ ("libgo_syscall.syscall.TrapCause.N32_libgo_syscall.syscall.WaitStatus"); int -TrapCause (uint32_t *w __attribute__ ((unused))) +TrapCause (uint32_t *w) { -#ifndef __linux__ +#if !(defined(WIFSTOPPED) && defined(WSTOPSIG) && defined(SIGTRAP)) + USED(w); return -1; #else if (!WIFSTOPPED (*w) || WSTOPSIG (*w) != SIGTRAP)