From c4aed82f941aa9acddfbb7e3fa0a521862ceb62d Mon Sep 17 00:00:00 2001 From: Jan Sarenik <244565+jsarenik@users.noreply.github.com> Date: Wed, 12 Dec 2018 18:08:07 +0100 Subject: [PATCH] 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 --- build | 1 + 1 file changed, 1 insertion(+) diff --git a/build b/build index e463c852..86ecfad7 100755 --- a/build +++ b/build @@ -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