https://stackoverflow.com/a/69774444/7607408 says:
You should be able to remove the gc_linkopts options from the build. Statically linking glibc is not really supported, and may be causing problems.
If you have other cgo libraries you need to link statically, you will need to provide the linker flags for those libraries specifically.
Which suggests that it's possible to only statically link a specific library. However I can't find any information on how to do that with the go command line?