Mk/Uses/go.mk: Add linker flags to omit symbol table and debug information
unless WITH_DEBUG is defined or port sets its own -ldflags.
PR: 233335
Differential D21730
Mk/Uses/go.mk: Omit symbol table and debug information by default dmgk on Sep 20 2019, 2:58 PM. Authored by Tags None Referenced Files
Details
Mk/Uses/go.mk: Add linker flags to omit symbol table and debug information PR: 233335 Tested with: poudriere testport devel/awless (doesn't set custom -ldflags)
Diff Detail
Event TimelineComment Actions I did some more testing and it turns out that this patch actually breaks a few ports (www/gohugo, devel/gitaly, mail/aerc) due to GO_BUILDFLAGS being expanded too early.
Comment Actions Pass just -s because GOFLAGS doesn't support spaces in values. This change depends on https://reviews.freebsd.org/D21735. Tested with poudriere bulk over all Go ports. Comment Actions IIUC this potentially changes all Go binaries, so all USES=go ports that do not set ldflags themselves probably need a PORTREVISION bump afterwards to relink them?
Comment Actions A quick search for f in $(find /usr/ports -name Makefile | xargs grep -l 'USES=.*\bgo\b'); do grep -q '\bldflags\b' $f || echo $f; done | wc -l shows that it would require bumping PORTREVISION of 198 ports. Recompiling will make binaries about 25% smaller on average but there are no other functional changes. I can prepare a separate review if we're OK with this. Comment Actions Review for PORTREVISION bump of ports without explicit -ldflags: https://reviews.freebsd.org/D21854 Comment Actions The exp-run (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240986) doesn't seem to be having any progress, I'm going to do a local test build of this change along with https://reviews.freebsd.org/D21854 and commit. |