mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-11 07:06:24 +02:00
autoflags adjustments for symbol stripping
Signed-off-by: Aaron Klotz <aaron@tailscale.com>
This commit is contained in:
parent
525f7a1e47
commit
3194d75343
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user