http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56171



--- Comment #9 from Rainer Orth <ro at gcc dot gnu.org> 2013-02-14 10:11:11 UTC 
---

Created attachment 29448

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29448

proposed patch for __xnet_ socket functions



This works fine in the 32-bit case, but for 64-bit (both sparc and x86) needed

one further adjustment: the 64-bit tests were failing like this:



  amd64:



--- FAIL: TestPassFD (0.09 seconds)

:0:     child process ReadAll: "", <nil>; want "Hello from child process!\n"

FAIL

FAIL: syscall



  sparcv9:



--- FAIL: TestPassFD (0.28 seconds)

passfd_test.go:102:     child process ReadAll: "", <nil>; want "Hello from

child process!\n"

FAIL

FAIL: syscall



(Btw., need to check why filename and line number aren't detected on x86...)



It turned out that as on Darwin, we always need 32-bit alignment.  The attached

patch does just that and allows the syscall to pass on both 32- and 64-bit

Solaris/SPARC and x86.



  Rainer



2013-02-13  Rainer Orth  <r...@cebitec.uni-bielefeld.de>



    PR go/5617

    * go/syscall/sockcmsg_unix.go: Import "runtime".

    (cmsgAlignOf): Enforce 32-bit alignment on Solaris.

    * go/syscall/socket.go (bind, connect, socket, socketpair)

    (getsockopt, sendto, recvmsg, sendmsg): Move ...

    * go/syscall/socket_posix.go: ... here.

    New file.

    * go/syscall/socket_xnet.go: New file.

    * Makefile.am (syscall_socket_os_file): New variable.

    (go_base_syscall_files): Use it.

    * Makefile.in: Regenerate.

Reply via email to