summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAaron Klotz <aaron@tailscale.com>2026-02-18 15:12:52 -0700
committerAaron Klotz <aaron@tailscale.com>2026-03-10 16:16:00 -0600
commit3194d75343b1a4df13a93705f144f8c9a176f7ba (patch)
tree04ab51906fab1e5b7fd3e643d13851c6e8c51311
parent525f7a1e47060309a2b9dd98ae8ee81374da743a (diff)
downloadtailscale-aaron/win_buildkite_go_syms.tar.xz
tailscale-aaron/win_buildkite_go_syms.zip
autoflags adjustments for symbol strippingaaron/win_buildkite_go_syms
Signed-off-by: Aaron Klotz <aaron@tailscale.com>
-rw-r--r--tool/gocross/autoflags.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go
index 405cad8b3..5b1537d2f 100644
--- a/tool/gocross/autoflags.go
+++ b/tool/gocross/autoflags.go
@@ -102,8 +102,14 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ
targetOS = "windows"
cgo = true
buildFlags = append(buildFlags, "-buildmode=c-shared")
- ldflags = append(ldflags, "-H", "windows", "-s")
+ ldflags = append(ldflags, "-H", "windows")
cgoLdflags = append(cgoLdflags, "-static")
+ if env.IsSet("TS_WINBUILD_WANT_SYMBOLS") {
+ cgoLdflags = append(cgoLdflags, "-g")
+ ldflags = append(ldflags, "-linkmode=external", fmt.Sprintf("'-extldflags=%s'", strings.Join("-s", " "))
+ } else {
+ ldflags = append(ldflags, "-s")
+ }
var mingwArch string
switch targetArch {
case "amd64":
@@ -117,9 +123,15 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ
case "windowsgui":
// Fake GOOS that translates to "windows, but building GUI .exes not console .exes"
targetOS = "windows"
- ldflags = append(ldflags, "-H", "windowsgui", "-s")
+ ldflags = append(ldflags, "-H", "windowsgui")
+ if !env.IsSet("TS_WINBUILD_WANT_SYMBOLS") {
+ ldflags = append(ldflags, "-s")
+ }
case "windows":
- ldflags = append(ldflags, "-H", "windows", "-s")
+ ldflags = append(ldflags, "-H", "windows")
+ if !env.IsSet("TS_WINBUILD_WANT_SYMBOLS") {
+ ldflags = append(ldflags, "-s")
+ }
case "ios":
failReflect = true
fallthrough