aboutsummaryrefslogtreecommitdiffstats
path: root/main/go/no-pic.patch
diff options
context:
space:
mode:
authorEivind Uggedal <eivind@uggedal.com>2015-09-15 14:24:00 +0000
committerEivind Uggedal <eivind@uggedal.com>2015-09-15 14:25:28 +0000
commite8e6bedb868fcb59df6f0d8128d1746a7b416151 (patch)
treee88891d3bd12b684baf76bb85e1ac701f6ca8012 /main/go/no-pic.patch
parent800f6d9de18651c4cf07981bd9b2d380aa1c39aa (diff)
downloadaports-e8e6bedb868fcb59df6f0d8128d1746a7b416151.tar.bz2
aports-e8e6bedb868fcb59df6f0d8128d1746a7b416151.tar.xz
main/go: re-add removed patches during 1.5 upgrade
no-pic: This is needed for building go executables on Alpine which uses the external linker (cgo). Examples from our tree include docker, consul and gogs. Go does not support compiling PIC executables. Since the gcc specs used by Alpine enables PIC by default it has to be disabled. Without disabling PIC the executable gets a ton of erroneous textrels which results in a segfault when musl tries to resolve them. _SC_GETPW_R_SIZE_MAX: since musl defines this to -1 we have to provide a default value. Use a more recent patch from upstream which will be available in Go 1.6.
Diffstat (limited to 'main/go/no-pic.patch')
-rw-r--r--main/go/no-pic.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/go/no-pic.patch b/main/go/no-pic.patch
new file mode 100644
index 0000000000..5a4e3966d6
--- /dev/null
+++ b/main/go/no-pic.patch
@@ -0,0 +1,16 @@
+diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
+index 8ccbec9dd634..4e96bfadc260 100644
+--- a/src/cmd/link/internal/ld/lib.go
++++ b/src/cmd/link/internal/ld/lib.go
+@@ -1071,6 +1071,11 @@ func hostlink() {
+ argv = append(argv, peimporteddlls()...)
+ }
+
++ // The Go linker does not currently support building PIE
++ // executables when using the external linker. See:
++ // https://github.com/golang/go/issues/6940
++ argv = append(argv, "-fno-PIC")
++
+ if Debug['v'] != 0 {
+ fmt.Fprintf(&Bso, "host link:")
+ for _, v := range argv {