From 6b659773f105d0f9efa7fa4a259c1b6b3492f2e4 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 19 Feb 2025 18:09:05 +0100 Subject: [PATCH] build release bins w/o symbols and debug, +static --- mkrel.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mkrel.sh b/mkrel.sh index 894deaf..ec20ca1 100755 --- a/mkrel.sh +++ b/mkrel.sh @@ -42,8 +42,15 @@ for D in $DIST; do binfile="releases/${tool}-${os}-${arch}-${version}" tardir="${tool}-${os}-${arch}-${version}" tarfile="releases/${tool}-${os}-${arch}-${version}.tar.gz" + pie="" + + if test "$D" = "linux/amd64"; then + pie="-buildmode=pie" + fi + set -x - GOOS=${os} GOARCH=${arch} go build -o ${binfile} -ldflags "-X 'github.com/tlinden/tablizer/cfg.VERSION=${version}'" + GOOS=${os} GOARCH=${arch} go build -tags osusergo,netgo -ldflags "-extldflags=-static -w -X 'github.com/tlinden/tablizer/cfg.VERSION=${version}'" --trimpath $pie -o ${binfile} + strip --strip-all ${binfile} mkdir -p ${tardir} cp ${binfile} README.md LICENSE ${tardir}/ echo 'tool = tablizer