This libgo patch changes mksysinfo.sh to add some more networking constants. This is really just a snapshot, there are more to come, based on differences between gccgo and the master Go library. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 888f1f45a4aa libgo/configure.ac --- a/libgo/configure.ac Tue Apr 03 10:56:09 2012 -0700 +++ b/libgo/configure.ac Tue Apr 03 12:33:57 2012 -0700 @@ -453,7 +453,7 @@ ;; esac -AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/reboot.h) +AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/reboot.h) AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [], [#ifdef HAVE_SYS_SOCKET_H diff -r 888f1f45a4aa libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Tue Apr 03 10:56:09 2012 -0700 +++ b/libgo/mksysinfo.sh Tue Apr 03 12:33:57 2012 -0700 @@ -94,6 +94,9 @@ #if defined(HAVE_NET_IF_H) #include <net/if.h> #endif +#if defined(HAVE_NET_IF_ARP_H) +#include <net/if_arp.h> +#endif #if defined(HAVE_SYS_MOUNT_H) #include <sys/mount.h> #endif @@ -211,7 +214,7 @@ fi # Networking constants. -egrep '^const _(AF|SOCK|SOL|SO|IPPROTO|TCP|IP|IPV6)_' gen-sysinfo.go | +egrep '^const _(AF|ARPHRD|SOCK|SOL|SO|IPPROTO|TCP|IP|IPV6)_' gen-sysinfo.go | sed -e 's/^\(const \)_\([^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} grep '^const _SOMAXCONN' gen-sysinfo.go | sed -e 's/^\(const \)_\(SOMAXCONN[^= ]*\)\(.*\)$/\1\2 = _\2/' \ @@ -710,6 +713,10 @@ # The routing message flags. grep '^const _RTA' gen-sysinfo.go | \ sed -e 's/^\(const \)_\(RTA[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +grep '^const _RTF' gen-sysinfo.go | \ + sed -e 's/^\(const \)_\(RTF[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +grep '^const _RTCF' gen-sysinfo.go | \ + sed -e 's/^\(const \)_\(RTCF[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} grep '^const _RTM' gen-sysinfo.go | \ sed -e 's/^\(const \)_\(RTM[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} @@ -938,6 +945,10 @@ -e 's/_sock_filter/SockFilter/' \ >> ${OUT} +# The GNU/Linux filter flags. +grep '^const _BPF_' gen-sysinfo.go | \ + sed -e 's/^\(const \)_\(BPF_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} + # The Solaris 11 Update 1 _zone_net_addr_t struct. grep '^type _zone_net_addr_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr/[16]byte/' \