Hi all,
FreeBSD has since a while also support for the netlink facility, similar to Linux. For Linux there is support in go via the syscall pkg for working with Linux's netlink, but not yet for FreeBSD
I have started to add the FreeBSD part to go's syscall package and fixed some errors, but run into troubles when compiling go. Though my approach is by now copying a lot form syscall_linux, as a first naive approach. :-)
When using make.bash these steps work:
Building Go cmd/dist using /usr/local/go122. (go1.22.6 freebsd/amd64)
Building Go toolchain1 using /usr/local/go122.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1
However, after "Building Go toolchain2 using go_bootstrap and Go toolchain1" this error turns out:
"go: cannot find GOROOT directory: /home/mls/goworks
go tool dist: FAILED: /home/mls/goworks/pkg/tool/freebsd_amd64/go_bootstrap install -pgo=off cmd/asm cmd/cgo cmd/compile cmd/link cmd/preprofile: exit status 2"
The changed go code is available here:
Compiling directly from go's git master branch succeeds, so I have managed to break something in my part. However, I have not found, other than make.bash -v, to get any further info or error message what is wrong.
Does anybody have a hint to get more or better infos during the build process why it fails?
go env below!
Thanks,
Martin
GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/mls/.cache/go-build'
GOENV='/home/mls/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='freebsd'
GOINSECURE=''
GOMODCACHE='/home/mls/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='freebsd'
GOPATH='/home/mls/go'
GOPRIVATE=''
GOPROXY='
https://proxy.golang.org,direct'
GOROOT='/usr/local/go122'
GOSUMDB='
sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go122/pkg/tool/freebsd_amd64'
GOVCS=''
GOVERSION='go1.22.6'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='cc'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/home/mls/goworks/src/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3067957388=/tmp/go-build -gno-record-gcc-switches'