aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-02-15 21:53:17 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2020-04-14 17:10:41 +0200
commite4dd5af8db40c72955e47aa6a03fe3ae08d3126b (patch)
tree956ee59356993e3db75b14d8810b863d2af3112d /main/abuild
parent32fe19c40e22ff217cc307569058a3d044b28f74 (diff)
downloadaports-e4dd5af8db40c72955e47aa6a03fe3ae08d3126b.tar.bz2
aports-e4dd5af8db40c72955e47aa6a03fe3ae08d3126b.tar.xz
main/abuild: add GOFLAGS to /etc/abuild.conf
Diffstat (limited to 'main/abuild')
-rw-r--r--main/abuild/0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch37
-rw-r--r--main/abuild/APKBUILD7
2 files changed, 41 insertions, 3 deletions
diff --git a/main/abuild/0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch b/main/abuild/0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch
new file mode 100644
index 0000000000..a3c2643d14
--- /dev/null
+++ b/main/abuild/0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch
@@ -0,0 +1,37 @@
+From 828b826662638b78834332f9cf72f18ac1fbf86f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Sun, 17 Mar 2019 17:03:59 +0100
+Subject: [PATCH] abuild.conf: enable PIE binaries by default for go as well
+
+From `go help environment`:
+
+ GOFLAGS
+ A space-separated list of -flag=value settings to apply
+ to go commands by default, when the given flag is known by
+ the current command. Flags listed on the command-line
+ are applied after this list and therefore override it.
+
+And from `go help build`:
+
+ -buildmode mode
+ build mode to use. See 'go help buildmode' for more.
+
+Setting this environment variable in /etc/abuild.conf allows us to build
+all go binaries on the builders as PIE without needing to patch the go
+compiler itself.
+---
+ abuild.conf | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/abuild.conf b/abuild.conf
+index 6721e7f..c00e31b 100644
+--- a/abuild.conf
++++ b/abuild.conf
+@@ -2,6 +2,7 @@ export CFLAGS="-Os -fomit-frame-pointer"
+ export CXXFLAGS="$CFLAGS"
+ export CPPFLAGS="$CFLAGS"
+ export LDFLAGS="-Wl,--as-needed"
++export GOFLAGS="-buildmode=pie"
+
+ export JOBS=2
+ export MAKEFLAGS=-j$JOBS
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index bce888f10d..9a6e8b06da 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.5.0
_ver=${pkgver%_git*}
-pkgrel=0
+pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -21,7 +21,7 @@ subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch
options="suid !check"
pkggroups="abuild"
source="https://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
- "
+ 0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch"
builddir="$srcdir/$pkgname-$_ver"
@@ -68,4 +68,5 @@ _rootbld() {
mkdir -p "$subpkgdir"
}
-sha512sums="30577da610c0677cdd60264d43ed6704e51bd652ed1d98a7bda90d836416c5c3d7ce02e27db9b2425c18a20177e9e6591315e4ab4ae21247288c3ac0eee12d38 abuild-3.5.0.tar.xz"
+sha512sums="30577da610c0677cdd60264d43ed6704e51bd652ed1d98a7bda90d836416c5c3d7ce02e27db9b2425c18a20177e9e6591315e4ab4ae21247288c3ac0eee12d38 abuild-3.5.0.tar.xz
+1f1e4fd291b6e52d7628d43b5b29db4aa0762f3dc8b87827aafc7052b752057026d15594d142dda96e149815f4352f98c10379bdea75b032e303a9351027ef9d 0001-abuild.conf-enable-PIE-binaries-by-default-for-go-as.patch"