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 <joel.sherr...@oarcorp.com>

        * 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.

--
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherr...@oarcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


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 <stdint.h>
 #include <sys/wait.h>
+#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)

Reply via email to