This libgo patch to the go command sources stops collecting package
CGOLDFLAGS when using gccgo. The flags are already collected via
cmd/cgo.
The gccgo_link_c test is tweaked to do real linking as with this
change the cgo ldflags are not fully reflected in go build -n output,
since they now only come from the built archive.
This is a backport of
https://go.dev/cl/497117 from the main repo.
This is for
https://go.dev/issue/60287.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed
to mainline.
Ian