Patchwork RTEMS Go Patch

login
register
mail settings
Submitter Joel Sherrill
Date Dec. 2, 2011, 7:46 p.m.
Message ID <4ED92B17.9090404@oarcorp.com>
Download mbox | patch
Permalink /patch/128947/
State New
Headers show

Comments

Joel Sherrill - Dec. 2, 2011, 7:46 p.m.
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.sherrill@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.
Ian Taylor - Dec. 13, 2011, 10 p.m.
Joel Sherrill <joel.sherrill@oarcorp.com> writes:

> 2011-12-02  Joel Sherrill <joel.sherrill@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.

I committed the changes to runtime/go-signal.c and
runtime/mem_posix_memalign.c.

As I mentioned in an earlier message, we probably don't want to compile
wait.c on RTEMS at all.  I will work on that now.

Ian

Patch

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)