From fc49c6e396ee09440b72023b05696746d4886813 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Wed, 10 Aug 2022 03:18:17 -0400 Subject: [PATCH] common/build-style/go.sh: error if -s/-w in go_ldflags -s Omit the symbol table and debug information. -w Omit the DWARF symbol table. both are not necessary because xbps-src should strip binaries itself this does not fit in an xlint because of multiline-string handling woes --- common/build-style/go.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/build-style/go.sh b/common/build-style/go.sh index d18116ee963..9093527860f 100644 --- a/common/build-style/go.sh +++ b/common/build-style/go.sh @@ -22,6 +22,13 @@ do_configure() { } do_build() { + # remove -s and -w from go_ldflags, we should let xbps-src strip binaries itself + for wd in $go_ldflags; do + if [ "$wd" == "-s" ] || [ "$wd" == "-w" ]; then + msg_error "$pkgname: remove -s and -w from go_ldflags\n" + fi + done + go_package=${go_package:-$go_import_path} # Build using Go modules if there's a go.mod file if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then