From 19b05766856fd8c1d5f334651051218ec0e7315e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Fri, 10 Apr 2020 17:54:35 -0300 Subject: [PATCH] go: enable PIE builds for Go executables Enabling PIE builds for Go executables created by gc enables us to remove the nostrip and nopie variables from those builds. nostrip was moved to the gccgo cases only. --- common/environment/build-style/go.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/environment/build-style/go.sh b/common/environment/build-style/go.sh index 3f83013d4f7..fd23421fa6e 100644 --- a/common/environment/build-style/go.sh +++ b/common/environment/build-style/go.sh @@ -4,15 +4,15 @@ if [ -z "$hostmakedepends" -o "${hostmakedepends##*gcc-go-tools*}" ]; then archs="aarch64* armv[567]* i686* x86_64* ppc64le*" fi hostmakedepends+=" go" - nopie=yes + export GOFLAGS="-buildmode=pie" else # gccgo compiler if [ "$CROSS_BUILD" ]; then # target compiler to use; otherwise it'll just call gccgo export GCCGO="${XBPS_CROSS_TRIPLET}-gccgo" fi + nostrip=yes fi -nostrip=yes case "$XBPS_TARGET_MACHINE" in aarch64*) export GOARCH=arm64;;