On Fri, Feb 15, 2019 at 4:03 AM Rainer Orth <r...@cebitec.uni-bielefeld.de> 
wrote:
>
> Andreas Schwab <sch...@linux-m68k.org> writes:
>
> > This breaks non-split-stack builds.
> >
> > ../../../libgo/runtime/stack.c: In function 'doscanstack1':
> > ../../../libgo/runtime/stack.c:113:18: error: passing argument 1 of
> > 'scanstackblock' makes integer from pointer without a cast
> > [-Werror=int-conversion]
> >   113 |   scanstackblock(bottom, (uintptr)(top - bottom), gcw);
> >       |                  ^~~~~~
> >       |                  |
> >       |                  byte * {aka unsigned char *}
>
> I see the same on Solaris.  Even with that fixed by appropriate casts to
> uintptr (plus a few more times), Solaris bootstrap is still broken by
> that patch:
>
> /vol/gcc/src/hg/trunk/local/libgo/runtime/go-varargs.c: In function 
> '__go_syscall6':
> /vol/gcc/src/hg/trunk/local/libgo/runtime/go-varargs.c:101:10: error: 
> implicit declaration of function 'syscall' 
> [-Werror=implicit-function-declaration]
>   101 |   return syscall (flag, a1, a2, a3, a4, a5, a6);
>       |          ^~~~~~~
>
> This needs to include <sys/syscall.h> for the syscall declaration, apart
> from the fundamental problem that syscall isn't a stable interface on
> Solaris.

I committed this patch which should fix the Solaris build.

The code was already calling syscall, it was just doing it in a way
that the types didn't necessarily match the C declaration.  This is
the implementation of Go's syscall.Syscall function, so there isn't
really anything else we can do.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 268939)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-a9c1a76e14b66a356d3c3dfb50f1e6138e97733c
+6877c95a5f44c3ab4f492d2000ce07771341d7b7
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/runtime/go-varargs.c
===================================================================
--- libgo/runtime/go-varargs.c  (revision 268923)
+++ libgo/runtime/go-varargs.c  (working copy)
@@ -12,6 +12,12 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYSCALL_H
+#include <syscall.h>
+#endif
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
 
 /* The syscall package calls C functions.  The Go compiler can not
    represent a C varargs functions.  On some systems it's important

Reply via email to