diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go index fd58c1fcb..c66cab55a 100644 --- a/tool/gocross/autoflags.go +++ b/tool/gocross/autoflags.go @@ -36,7 +36,7 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ targetOS = cmp.Or(env.Get("GOOS", ""), nativeGOOS) targetArch = cmp.Or(env.Get("GOARCH", ""), nativeGOARCH) buildFlags = []string{"-trimpath"} - cgoCflags = []string{"-O3", "-std=gnu11"} + cgoCflags = []string{"-O3", "-std=gnu11", "-g"} cgoLdflags []string ldflags []string tags = []string{"tailscale_go"} diff --git a/tool/gocross/autoflags_test.go b/tool/gocross/autoflags_test.go index 438198de7..8f24dd8a3 100644 --- a/tool/gocross/autoflags_test.go +++ b/tool/gocross/autoflags_test.go @@ -41,7 +41,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -67,7 +67,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -96,7 +96,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=0 (was ) CGO_LDFLAGS= (was ) GOARCH=riscv64 (was riscv64) @@ -125,7 +125,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=0 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -151,7 +151,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -181,7 +181,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=0 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -210,7 +210,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=0 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -240,7 +240,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was 1) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -266,7 +266,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=arm64 (was ) @@ -295,7 +295,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=arm64 (was ) @@ -324,7 +324,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=arm64 (was ) @@ -353,7 +353,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was amd64) @@ -382,7 +382,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=arm64 (was ) @@ -415,7 +415,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "arm64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 -mmacosx-version-min=11.3 -isysroot /my/sdk/root -arch x86_64 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g -mmacosx-version-min=11.3 -isysroot /my/sdk/root -arch x86_64 (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS=-mmacosx-version-min=11.3 -isysroot /my/sdk/root -arch x86_64 (was ) GOARCH=amd64 (was amd64) @@ -448,7 +448,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 -miphoneos-version-min=15.0 -isysroot /my/sdk/root -arch arm64 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g -miphoneos-version-min=15.0 -isysroot /my/sdk/root -arch arm64 (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS=-miphoneos-version-min=15.0 -isysroot /my/sdk/root -arch arm64 (was ) GOARCH=arm64 (was arm64) @@ -474,7 +474,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -500,7 +500,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -529,7 +529,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -556,7 +556,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was ) @@ -586,7 +586,7 @@ func TestAutoflags(t *testing.T) { nativeGOARCH: "amd64", envDiff: `CC=cc (was ) -CGO_CFLAGS=-O3 -std=gnu11 (was ) +CGO_CFLAGS=-O3 -std=gnu11 -g (was ) CGO_ENABLED=1 (was ) CGO_LDFLAGS= (was ) GOARCH=amd64 (was )