build: add -buildmode=pie

Make all dynbinary builds be position-independent (this adds both
security benefits and can help with flaky builds on POWER
architectures).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2018-07-30 19:34:01 +10:00
parent edfd623594
commit 164e812b7a
No known key found for this signature in database
GPG Key ID: 9E18AA267DDB8DB4
1 changed files with 1 additions and 1 deletions

View File

@ -9,6 +9,6 @@ source ./scripts/build/.variables
echo "Building dynamically linked $TARGET" echo "Building dynamically linked $TARGET"
export CGO_ENABLED=1 export CGO_ENABLED=1
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" "${SOURCE}" go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}"
ln -sf "$(basename "${TARGET}")" build/docker ln -sf "$(basename "${TARGET}")" build/docker