summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-03 21:18:56 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-03 21:18:56 +0000
commite487326d35e0bd2acf2920ab402a028571c99131 (patch)
tree91bb0c10eb34456977a82dcf78aec4e8f864cddb /libgo
parent8ad95372fddd961f9a643fda7ee0db438255fb91 (diff)
downloadgcc-e487326d35e0bd2acf2920ab402a028571c99131.tar.gz
syscall: RawSockaddr fix for ppc64, ppc64le
The struct RawSockaddr contains a field Data which should be uint8 on ppc64 and ppc64le, but is declared as int8 in gccgo. This change adds a two new files which contain the structure declaration for RawSockaddr, one with the correct types for for ppc64 and ppc64le, and the other for non-ppc64 platforms. Fixes golang/go#11469 Reviewed-on: https://go-review.googlesource.com/11946 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226533 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/Makefile.am11
-rw-r--r--libgo/Makefile.in5
-rw-r--r--libgo/go/syscall/socket_linux.go5
-rw-r--r--libgo/go/syscall/socket_linux_ppc64x_type.go14
-rw-r--r--libgo/go/syscall/socket_linux_type.go14
5 files changed, 44 insertions, 5 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index fa4fcaa6404..1676624360d 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1676,7 +1676,17 @@ endif # !LIBGO_IS_LINUX
# Define socket sizes and types.
if LIBGO_IS_LINUX
syscall_socket_file = go/syscall/socket_linux.go epoll.go
+if LIBGO_IS_PPC64LE
+syscall_socket_type_file = go/syscall/socket_linux_ppc64x_type.go
else
+if LIBGO_IS_PPC64
+syscall_socket_type_file = go/syscall/socket_linux_ppc64x_type.go
+else
+syscall_socket_type_file = go/syscall/socket_linux_type.go
+endif
+endif
+else
+syscall_socket_type_file =
if LIBGO_IS_SOLARIS
syscall_socket_file = go/syscall/socket_solaris.go
else
@@ -1762,6 +1772,7 @@ go_base_syscall_files = \
$(syscall_size_file) \
$(syscall_socket_file) \
$(syscall_socket_os_file) \
+ $(syscall_socket_type_file) \
$(syscall_uname_file) \
$(syscall_netlink_file) \
$(syscall_lsf_file) \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 99ffbb27611..7f0ee54c1df 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1848,6 +1848,10 @@ go_unicode_utf8_files = \
# Define socket sizes and types.
@LIBGO_IS_LINUX_TRUE@syscall_socket_file = go/syscall/socket_linux.go epoll.go
+@LIBGO_IS_LINUX_FALSE@syscall_socket_type_file =
+@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_PPC64LE_FALSE@@LIBGO_IS_PPC64_FALSE@syscall_socket_type_file = go/syscall/socket_linux_type.go
+@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_PPC64LE_FALSE@@LIBGO_IS_PPC64_TRUE@syscall_socket_type_file = go/syscall/socket_linux_ppc64x_type.go
+@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_PPC64LE_TRUE@syscall_socket_type_file = go/syscall/socket_linux_ppc64x_type.go
@LIBGO_IS_SOLARIS_FALSE@syscall_socket_os_file = go/syscall/socket_posix.go
# Define socket functions.
@@ -1898,6 +1902,7 @@ go_base_syscall_files = \
$(syscall_size_file) \
$(syscall_socket_file) \
$(syscall_socket_os_file) \
+ $(syscall_socket_type_file) \
$(syscall_uname_file) \
$(syscall_netlink_file) \
$(syscall_lsf_file) \
diff --git a/libgo/go/syscall/socket_linux.go b/libgo/go/syscall/socket_linux.go
index 8546abc3e06..5064e771221 100644
--- a/libgo/go/syscall/socket_linux.go
+++ b/libgo/go/syscall/socket_linux.go
@@ -136,11 +136,6 @@ type RawSockaddrNetlink struct {
Groups uint32
}
-type RawSockaddr struct {
- Family uint16
- Data [14]int8
-}
-
// BindToDevice binds the socket associated with fd to device.
func BindToDevice(fd int, device string) (err error) {
return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)
diff --git a/libgo/go/syscall/socket_linux_ppc64x_type.go b/libgo/go/syscall/socket_linux_ppc64x_type.go
new file mode 100644
index 00000000000..8a707ce49da
--- /dev/null
+++ b/libgo/go/syscall/socket_linux_ppc64x_type.go
@@ -0,0 +1,14 @@
+// socket_linux_ppc64x_type.go -- Socket handling specific to ppc64 GNU/Linux.
+
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+// Type needed on ppc64le & ppc64
+
+type RawSockaddr struct {
+ Family uint16
+ Data [14]uint8
+}
diff --git a/libgo/go/syscall/socket_linux_type.go b/libgo/go/syscall/socket_linux_type.go
new file mode 100644
index 00000000000..45b8c6ec1d0
--- /dev/null
+++ b/libgo/go/syscall/socket_linux_type.go
@@ -0,0 +1,14 @@
+// socket_linux_type.go -- Socket handling specific to GNU/Linux.
+
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+// Type needed if not on ppc64le or ppc64
+
+type RawSockaddr struct {
+ Family uint16
+ Data [14]int8
+}