Compile really static with no pie

On Alpine Linux (musl-libc based GNU/Linux distribution)

Before: $ file yggdrasil
yggdrasil: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

After: $ file yggdrasil
yggdrasil: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
This commit is contained in:
Jan Sarenik 2018-12-12 18:08:07 +01:00
parent 7c51d9e971
commit c4aed82f94

1
build
View file

@ -5,6 +5,7 @@ PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)}
PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
LDFLAGS="$LDFLAGS -extldflags '-static -no-pie'"
while getopts "udtc:l:" option
do