Sorry for the late replies, I've been busier than expected last week.
For that error I found that Brad already hit the same issue in https://github.com/cri-o/cri-o/issues/8860#issuecomment-2558287657 and fixed by applying "%global __golang_extldflags -Wl,-z,undefs" after %build in https://src.fedoraproject.org/rpms/cri-o/blob/rawhide/f/cri-o.spec#_107
Great! That worked.
I now have a build available at:
https://copr.fedorainfracloud.org/coprs/mikep/golang/build/9132012/
The last thing to figure out is the checks. I had to deactivate many of them, as the build system does not seem to properly apply "-Wl,-z,undefs" to %gocheck. I did some fiddling around in /usr/lib/macros.d/macros.go-rpm, but I have not yet figured out the problem.
Here is the result of %gocheck -v:
command: go test -buildmode pie -compiler gc -ldflags " -X github.com/gohugoio/hugo/version=0.147.7 -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -Wl,-z,undefs'"
I do see "-Wl,-z,undefs", but running the tests still causes errors like this:
github.com/gohugoio/hugo/vendor/github.com/tetratelabs/wazero/internal/engine/wazevo.(*callEngine).callWithStack: relocation target github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64.entrypoint not defined github.com/gohugoio/hugo/vendor/github.com/tetratelabs/wazero/internal/engine/wazevo.(*callEngine).callWithStack: relocation target github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64.afterGoFunctionCallEntrypoint not defined FAIL github.com/gohugoio/hugo/cache/filecache [build failed]