From 5e3126f5100a0efd4422165e3a5ae4f45c1e82f5 Mon Sep 17 00:00:00 2001 From: Nick Khyl Date: Fri, 15 Dec 2023 14:18:17 -0600 Subject: [PATCH] tool/gocross: make all Windows DLLs build with static libgcc In this commit, we have updated the build process for our Windows DLLs to link statically with libgcc, ensuring our Windows DLLs are self-contained. Updates #10617 Signed-off-by: Nick Khyl --- tool/gocross/autoflags.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go index 10c977b32..7d133de01 100644 --- a/tool/gocross/autoflags.go +++ b/tool/gocross/autoflags.go @@ -96,6 +96,7 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ cgo = true buildFlags = append(buildFlags, "-buildmode=c-shared") ldflags = append(ldflags, "-H", "windows", "-s") + cgoLdflags = append(cgoLdflags, "-static") var mingwArch string switch targetArch { case "amd64":