This patch from Peter Collingbourne backports a patch from the master repository to pass CGO_LDFLAGS to the linker when using cgo with gccgo. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r b0a83aacb539 libgo/go/cmd/go/build.go --- a/libgo/go/cmd/go/build.go Fri Jan 09 13:17:25 2015 -0800 +++ b/libgo/go/cmd/go/build.go Fri Jan 09 16:41:10 2015 -0800 @@ -1895,6 +1895,7 @@ } ldflags = append(ldflags, afiles...) ldflags = append(ldflags, cgoldflags...) + ldflags = append(ldflags, envList("CGO_LDFLAGS", "")...) ldflags = append(ldflags, p.CgoLDFLAGS...) if usesCgo && goos == "linux" { ldflags = append(ldflags, "-Wl,-E")