aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/go/APKBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/community/go/APKBUILD b/community/go/APKBUILD
index 10c0d1cb49..b37381b09f 100644
--- a/community/go/APKBUILD
+++ b/community/go/APKBUILD
@@ -4,7 +4,7 @@
pkgname=go
# go binaries are statically linked, security updates require rebuilds
pkgver=1.13.8
-pkgrel=1
+pkgrel=2
pkgdesc="Go programming language compiler"
url="https://golang.org/"
arch="all"
@@ -75,6 +75,11 @@ mipsel) export GOARCH="mipsle" GOMIPS=softfloat ;;
*) export GOARCH="unsupported";;
esac
+# compile go itself as a PIE on supported arches.
+case "$CARCH" in
+x86_64|s390x|aarch64) export GO_LDFLAGS=-buildmode=pie ;;
+esac
+
builddir="$srcdir"/go
build() {
cd "$builddir/src"