From: Carlos Amedee Date: Wed, 22 Jan 2020 20:30:52 +0000 (-0500) Subject: [release-branch.go1.13] cmd/link: ensure cgo cflags do not leak into tvOS test X-Git-Tag: go1.13.9~7 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4169b1ea15139d00736cb616f122fef04adb2512;p=gostls13.git [release-branch.go1.13] cmd/link: ensure cgo cflags do not leak into tvOS test Running the 'TestBuildForTvOS' test with CGO_CFLAGS set with certain values would cause the test to fail. all.bash would fail when CGO_CFLAGS was set to '-mmacosx-version-min=10.10' because the --macosx-version-min flag is incompatible with tvOS. The change guards against using an unintended flag in the unit test. Updates #36846 Updated #35459 Change-Id: Ifc43f3ebfb23d37aabeaac2ea9efae5b877991bf Reviewed-on: https://go-review.googlesource.com/c/go/+/215957 Run-TryBot: Carlos Amedee TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor (cherry picked from commit ace25f82df0a27eb26a518e1883eb56c1bec6c5e) Reviewed-on: https://go-review.googlesource.com/c/go/+/218598 --- diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 155fd8bce3..92bfcfd752 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -214,6 +214,7 @@ func TestBuildForTvOS(t *testing.T) { "GOOS=darwin", "GOARCH=arm64", "CC="+strings.Join(CC, " "), + "CGO_CFLAGS=", // ensure CGO_CFLAGS does not contain any flags. Issue #35459 ) if out, err := cmd.CombinedOutput(); err != nil { t.Fatalf("%v: %v:\n%s", cmd.Args, err, out)