Golang: sort out -buildmode=pie and CGO_ENABLED=0 since 1.22 upgrade
Since the community/go
upgrade to 1.22, many aports will fail to build, some already have, for several architectures (armhf
, armv7
, riscv64
, s390x
& x86
) when CGO_ENABLED=0
. Many aports have this set in their APKBUILD
file but additional may have it set in their build scripts. Removing -buildmode=pie
from GOFLAGS
, while still having CGO_ENABLED=0
, works.
Since we probably don't want to disable PIE we should instead remove CGO_ENABLE=0
from APKBUILD
files tree-wide and where it occurs in Makefile
s and similar.
This upstream issue could be related: https://github.com/golang/go/issues/64875
Here's a Gentoo issue: https://bugs.gentoo.org/924629
I also haven't dug into this much myself, just thought it'd be good to have an issue to track it.
Edited by omni