Re: go: shrink binaries
Thomas Klausner <[email protected]> Mon, 25 May 2026 09:09:29 +0200
| Newsgroups | gmane.os.netbsd.devel.packages |
|---|---|
| Message-ID | <[email protected]> |
Hi! On Mon, May 25, 2026 at 09:00:22AM +0100, Adam CiarciĆski wrote: > To all go modules, can we add: > > -ldflags='-s -w' to omit symbol table (-s) and strip debug information (-w), and also Perhaps make this part conditional on INSTALL_UNSTRIPPED being set to 'no'. > -trimpath to avoid baking full GOPATH/module paths into binaries (without it, there is a work directory reference, so CHECK_WRKREF_SKIP can possible be removed in lang/go/go-module.mk) Neat! > But GOFLAGS won't propagate, because many packages override it. > > Is there a better way to achieve this? Perhaps we can change the packages to use += ? Thomas