We skip many gccgo tests by setting GCCGO to a bogus value. However, this particular test doesn't properly handle a non-existing $GCCGO hence we unset the environment variable here. diff -upr go.orig/src/cmd/go/testdata/script/gccgo_link_c.txt go/src/cmd/go/testdata/script/gccgo_link_c.txt --- go.orig/src/cmd/go/testdata/script/gccgo_link_c.txt 2022-09-30 10:58:07.524516646 +0200 +++ go/src/cmd/go/testdata/script/gccgo_link_c.txt 2022-09-30 10:58:29.441202925 +0200 @@ -4,6 +4,8 @@ [!cgo] skip [!exec:gccgo] skip +env GCCGO= + go build -n -compiler gccgo stderr 'gccgo.*\-L [^ ]*alibpath \-lalib' # make sure that Go-inline "#cgo LDFLAGS:" ("-L alibpath -lalib") passed to gccgo linking stage