-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
The declaration for the struct RawSockaddr in gccgo from gcc5 branch when used on ppc64le does not match what is provided in golang for go 1.5. Since they should be using the same syscalls on the ppc64le platform, the data structures should be the same. Having different declarations in the two compilers is preventing some source code from building successfully with both compilers.
From gccgo in libgo/go/syscall/socket_linux.go:
type RawSockaddr struct {
Family uint16
Data [14]int8
}
In golang for go 1.5 on ppc64le, the generated ztypes_linux_ppc64le.go contains this:
type RawSockaddr struct {
Family uint16
Data [14]uint8
}
My understanding is that the original C header file that these are generated from is sys/socket.h and has Data declared as a char, which on ppc64le should be an unsigned 8 bit integer. Based on that, the declaration provided in golang for go 1.5 on ppc64le is correct but incorrect for gccgo from gcc 5.0 using go 1.4.2.
I suspect we don't want to just change the declaration in socket_linux.go in gccgo because it is not the same for all platforms.