mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-16 12:01:00 +01:00
pie only on linux
This commit is contained in:
7
mkrel.sh
7
mkrel.sh
@@ -45,15 +45,20 @@ for D in $DIST; do
|
|||||||
os=${D/\/*/}
|
os=${D/\/*/}
|
||||||
arch=${D/*\//}
|
arch=${D/*\//}
|
||||||
binfile="releases/${tool}-${os}-${arch}-${version}"
|
binfile="releases/${tool}-${os}-${arch}-${version}"
|
||||||
|
pie=""
|
||||||
|
|
||||||
if test "$os" = "windows"; then
|
if test "$os" = "windows"; then
|
||||||
binfile="${binfile}.exe"
|
binfile="${binfile}.exe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$D" = "linux/amd64"; then
|
||||||
|
pie="-buildmode=pie"
|
||||||
|
fi
|
||||||
|
|
||||||
tardir="${tool}-${os}-${arch}-${version}"
|
tardir="${tool}-${os}-${arch}-${version}"
|
||||||
tarfile="releases/${tool}-${os}-${arch}-${version}.tar.gz"
|
tarfile="releases/${tool}-${os}-${arch}-${version}.tar.gz"
|
||||||
set -x
|
set -x
|
||||||
GOOS=${os} GOARCH=${arch} go build -tags osusergo,netgo -ldflags "-extldflags=-static -w" --trimpath -buildmode=pie -o ${binfile}
|
GOOS=${os} GOARCH=${arch} go build -tags osusergo,netgo -ldflags "-extldflags=-static -w" --trimpath $pie -o ${binfile}
|
||||||
strip --strip-all ${binfile}
|
strip --strip-all ${binfile}
|
||||||
mkdir -p ${tardir}
|
mkdir -p ${tardir}
|
||||||
cp ${binfile} README.md LICENSE ${tardir}/
|
cp ${binfile} README.md LICENSE ${tardir}/
|
||||||
|
|||||||
Reference in New Issue
Block a user