Commit 9e520fc4 authored by Chaoting Liu's avatar Chaoting Liu

go: rebuild with pie enabled

parent c83835d2
Pipeline #1444 failed with stages
in 10 minutes and 18 seconds
pkgbase=go
pkgname=(go) #to enable go-pie gcc should be compiled with --enable-default-pie
pkgname=go #to enable go-pie gcc should be compiled with --enable-default-pie
pkgver=1.11.1
pkgrel=1
pkgrel=2
arch=(x86_64)
url='http://golang.org/'
license=(BSD)
makedepends=(git go)
source=(https://storage.googleapis.com/golang/go$pkgver.src.tar.gz)
sha256sums=('558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117')
source=(https://storage.googleapis.com/golang/go$pkgver.src.tar.gz
default-buildmode-pie.patch)
sha256sums=('558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117'
'9d2f0d201d4e002d74f548cc82bd131139bab5dd62191004c71dd430fdc1666d')
export GOOS=linux
export GOARCH=amd64
......@@ -15,22 +16,20 @@ export GOROOT_FINAL=/usr/lib/go
export GOROOT_BOOTSTRAP=/usr/lib/go
prepare() {
cp -r $pkgbase ${pkgbase}-pie
cd $pkgbase
patch -p1 -i "$srcdir"/default-buildmode-pie.patch
}
build() {
export GOPATH="$srcdir/"
export GOROOT="$srcdir/$pkgname"
export GOBIN="$GOROOT/bin"
for _pkgname in ${pkgname[@]}; do
export GOROOT="$srcdir/$_pkgname"
export GOBIN="$GOROOT/bin"
cd "$srcdir/$_pkgname/src"
./make.bash --no-clean
cd "$srcdir/$pkgname/src"
./make.bash --no-clean
PATH="$GOBIN:$PATH" go install -buildmode=shared std
PATH="$GOBIN:$PATH" go install -race std
done
PATH="$GOBIN:$PATH" go install -buildmode=shared std
PATH="$GOBIN:$PATH" go install -race std
}
check() {
......@@ -64,7 +63,7 @@ _package() {
}
package_go() {
pkgdesc='Core compiler tools for the Go programming language'
pkgdesc='Core compiler tools for the Go programming language (with PIE enabled by default)'
provides=(go-pie)
conflicts=(go-pie)
......
diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
index 9a1204866e..8b41832ae2 100644
--- a/src/cmd/go/internal/work/build.go
+++ b/src/cmd/go/internal/work/build.go
@@ -304,7 +304,8 @@ func BuildModeInit() {
diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go
index 7f894f5..a517887 100644
--- a/src/cmd/go/internal/work/init.go
+++ b/src/cmd/go/internal/work/init.go
@@ -111,7 +111,8 @@ func buildModeInit() {
ldBuildmode = "c-shared"
case "default":
switch platform {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment