--- libgo/go/syscall/route_bsd.go.orig 2020-03-04 19:30:03.000000000 +1100 +++ libgo/go/syscall/route_bsd.go 2020-09-08 16:08:18.971152000 +1000 @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd +// +build bsdsunix darwin dragonfly freebsd netbsd openbsd package syscall @@ -13,6 +13,7 @@ var ( freebsdConfArch string // "machine $arch" line in kern.conftxt on freebsd + bsdsunixConfArch string // "machine $arch" line in kern.conftxt on bsdsunix minRoutingSockaddrLen = rsaAlignOf(0) ) @@ -27,6 +28,14 @@ // NetBSD 6 and beyond kernels require 64-bit aligned // access to routing facilities. salign = 8 + } else if runtime.GOOS == "bsdsunix" { + // In the case of kern.supported_archs="amd64 i386", + // we need to know the underlying kernel's + // architecture because the alignment for routing + // facilities are set at the build time of the kernel. + if bsdsunixConfArch == "amd64" { + salign = 8 + } } else if runtime.GOOS == "freebsd" { // In the case of kern.supported_archs="amd64 i386", // we need to know the underlying kernel's