Closed kcning closed 1 year ago
Hi @kcning !
cgo: cannot load DWARF output from $WORK/b085//cgo.o: zlib: invalid header
Based on previous reports, it looks like a problem of your system (not your distro):
https://github.com/evilsocket/opensnitch/issues/820
cgo: cannot load DWARF output from $WORK/b084//cgo.o: zlib: invalid header
I just built the package with go 1.20.1 on Debian and compiled fine, so it doesn't seem an incompatibility with go (I've been using go1.19 for months, and the official packages on Debian are built with go1.19).
Maybe some hardening feature of Gentoo?
Thank you for the quick reply. It might be some hardening flags indeed. I'll look into it further.
Also affecting opensnitch package in nixos-unstable recently https://github.com/NixOS/nixpkgs/issues/216388 Not sure how to fix it yet :(
It seems to be a problem with Go >= 1.19 and -fstack-protector
. With Go <= 1.18 compiled fine, and apparently they'll try to fix it on next releases.
https://github.com/golang/go/issues/54422
https://github.com/golang/go/issues/54422#issuecomment-1224310014
With -fstack-protector (zlib: invalid header error)
With -fno-stack-protector (no error)
It seems that Go has been adding/removing -fno-stack-protector
by default: https://github.com/golang/go/commits/master/src/runtime/cgo/cgo.go
// Use -fno-stack-protector to avoid problems locating the
// proper support functions. See issues #52919, #54313, #58385.
#cgo CFLAGS: -Wall -Werror -fno-stack-protector
We also debugged this issue here: https://github.com/evilsocket/opensnitch/discussions/768
closing this issue. Either use the mentioned option, or use another golang version.
Hello,
I packaged opensnitch for a Gentoo overlay, and I noticed that opensnitch wouldn't build with go version >= 1.19. I'm quite certain it's not a distribution issue (EDIT: ok maybe not...).
As a temporary workaround, if I modify the opensnitch/daemon/Makefile as follows
then the build works.
For now I'm not sure what caused the issue, as I'm not a GO guru. It appears to me there is a breaking change in Go 1.19 release.
And last but not the least: thank you for this nice software!