New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gccgo, syscall: unknowndefine NLA_HDRLEN #13629
Comments
This needs the "Constants that may only be defined as expressions on some systems" treatment in libgo/mksysinfo.sh. |
Thanks for the pointer, I'll try it. |
https://go-review.googlesource.com/#/c/17893 |
Testing complete. |
NLA_HDRLEN is not in gccgo (as of 5.3), so use a C library header for now. See golang/go#13629 Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
NLA_HDRLEN is not in gccgo (as of 5.3), so use a C library header for now. See golang/go#13629 Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
NLA_HDRLEN is not in gccgo (as of 5.3), so use a C library header for now. See golang/go#13629 Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
I've uploaded the changes to mksysinfo.sh. I was looking in the file sysinfo.go and I see there is also a constant named SizeofNlAttr. Shouldn't this always be the same value as NLA_HDRLEN? If so then I think the Docker folks could use syscall.SizeofNlAttr instead of syscall.NLA_HDRLEN and it should work for both gccgo and gc. |
Never mind, I missed the alignment difference. |
syscall.NLA_HDRLEN is not in gccgo (as of 5.3), so in the meantime use the #defines taken from linux/netlink.h. See golang/go#13629 Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
CL was committed. Not sure why it didn't auto-close. |
The definition for syscall NLA_HDRLEN is missing from gccgo in both trunk and the release 5 branch. This is the only one of the NLA_* syscall defines missing from gccgo. All of these syscall are correctly defined in golang master and go 1.5.x branch.
Testcase:
package main
import (
"fmt"
"syscall"
)
func main() {
fmt.Printf("NLA_HDRLEN: %x\n", syscall.NLA_HDRLEN)
fmt.Printf("NLA_F_NESTED: %x\n", syscall.NLA_F_NESTED)
fmt.Printf("NLA_F_NET_BYTEORDER: %x\n", syscall.NLA_F_NET_BYTEORDER)
fmt.Printf("NLA_ALIGNTO: %x\n", syscall.NLA_ALIGNTO)
}
With gccgo this error occurs:
error: reference to undefined identifier 'syscall.NLA_HDRLEN'
fmt.Printf("NLA_HDRLEN: %x\n", syscall.NLA_HDRLEN)
Testcase compiles correctly with golang.
Comment out the line with NLA_HDRLEN and the testcase compiles correctly with gccgo.
The text was updated successfully, but these errors were encountered: