]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: disable cgo when testing internal linking of PIE
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 31 Aug 2022 02:37:22 +0000 (09:37 +0700)
committerGopher Robot <gobot@golang.org>
Wed, 31 Aug 2022 20:33:16 +0000 (20:33 +0000)
Since when internal linking cgo on some platforms, like android, is not
fully supported.

Updates #46731

Change-Id: I344a763f8dfb0cce04371d9305eee634bfd9ee77
Reviewed-on: https://go-review.googlesource.com/c/go/+/426199
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/cmd/dist/test.go

index 6372054929e56b1182e54a946b018c80f578c9ed..37fc5eaae065967f21699eb1ca4fd2af62955a5a 100644 (file)
@@ -718,7 +718,8 @@ func (t *tester) registerTests() {
                        name:    "pie_internal",
                        heading: "internal linking of -buildmode=pie",
                        fn: func(dt *distTest) error {
-                               t.addCmd(dt, "src", t.goTest(), "reflect", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60))
+                               cmd := t.addCmd(dt, "src", t.goTest(), "reflect", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60))
+                               setEnv(cmd, "CGO_ENABLED", "0")
                                return nil
                        },
                })