diff options
author | fhajny <fhajny@pkgsrc.org> | 2015-08-25 21:02:52 +0000 |
---|---|---|
committer | fhajny <fhajny@pkgsrc.org> | 2015-08-25 21:02:52 +0000 |
commit | a53e9c1e395b07f331836bccd7266eed050d499b (patch) | |
tree | 2d1c9081ce45c58da35b7fda10ce9115ba8177ea /lang/go | |
parent | b87ee86273cb9d77acf8dbcb9f8f34af21ffad94 (diff) | |
download | pkgsrc-a53e9c1e395b07f331836bccd7266eed050d499b.tar.gz |
Remove stale cgo/SunOS patches that are no longer needed. Fixes SunOS build.
Fix problem with -lsendfile needed on SunOS when building 3rd party software
that uses the net package.
Diffstat (limited to 'lang/go')
-rw-r--r-- | lang/go/distinfo | 6 | ||||
-rw-r--r-- | lang/go/patches/patch-misc_cgo_testso_cgoso.go | 14 | ||||
-rw-r--r-- | lang/go/patches/patch-src_cmd_go_build.go | 17 | ||||
-rw-r--r-- | lang/go/patches/patch-src_net_sendfile__solaris.go | 17 | ||||
-rw-r--r-- | lang/go/patches/patch-src_runtime_cgo_gcc__solaris__amd64.c | 80 |
5 files changed, 19 insertions, 115 deletions
diff --git a/lang/go/distinfo b/lang/go/distinfo index 52da86629b4..54ed73a803c 100644 --- a/lang/go/distinfo +++ b/lang/go/distinfo @@ -1,9 +1,7 @@ -$NetBSD: distinfo,v 1.23 2015/08/22 10:51:20 bsiegert Exp $ +$NetBSD: distinfo,v 1.24 2015/08/25 21:02:52 fhajny Exp $ SHA1 (go1.5.src.tar.gz) = 7242bb5ae29594641c75bdc3453d5854cc0a8604 RMD160 (go1.5.src.tar.gz) = 63abe7fd915997b53fdb0f8d2d071f0e4d549823 Size (go1.5.src.tar.gz) = 12045689 bytes -SHA1 (patch-misc_cgo_testso_cgoso.go) = ef782a6f173c814656eac0df640aedaa1a923bbc -SHA1 (patch-src_cmd_go_build.go) = f7705aa955241d3add353a144a676a58a0a1617e SHA1 (patch-src_cmd_go_pkg.go) = ccc470577951bd00741c39229599c0c06be52d0a -SHA1 (patch-src_runtime_cgo_gcc__solaris__amd64.c) = dea780dd3b6bed7cfa41e250eb01ab8137405562 +SHA1 (patch-src_net_sendfile__solaris.go) = 301b1d7f607a676864a3ce568d32036b6199659e diff --git a/lang/go/patches/patch-misc_cgo_testso_cgoso.go b/lang/go/patches/patch-misc_cgo_testso_cgoso.go deleted file mode 100644 index af8b604d8cd..00000000000 --- a/lang/go/patches/patch-misc_cgo_testso_cgoso.go +++ /dev/null @@ -1,14 +0,0 @@ -$NetBSD: patch-misc_cgo_testso_cgoso.go,v 1.1 2015/03/10 13:11:36 jperkin Exp $ - -Support cgo on illumos. - ---- misc/cgo/testso/cgoso.go.orig 2014-12-11 01:18:10.000000000 +0000 -+++ misc/cgo/testso/cgoso.go -@@ -14,6 +14,7 @@ package cgosotest - #cgo netbsd LDFLAGS: -L. libcgosotest.so - #cgo darwin LDFLAGS: -L. libcgosotest.dylib - #cgo windows LDFLAGS: -L. libcgosotest.dll -+#cgo solaris LDFLAGS: -L. -lcgosotest - - void init(void); - void sofunc(void); diff --git a/lang/go/patches/patch-src_cmd_go_build.go b/lang/go/patches/patch-src_cmd_go_build.go deleted file mode 100644 index c492c2d77af..00000000000 --- a/lang/go/patches/patch-src_cmd_go_build.go +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-src_cmd_go_build.go,v 1.3 2015/03/10 13:11:36 jperkin Exp $ - -Support cgo on illumos. - ---- src/cmd/go/build.go.orig 2014-12-11 01:18:12.000000000 +0000 -+++ src/cmd/go/build.go -@@ -2330,6 +2330,10 @@ func (b *builder) cgo(p *Package, cgoExe - if pie { // we need to use -pie for Linux/ARM to get accurate imported sym - cgoLDFLAGS = append(cgoLDFLAGS, "-pie") - } -+ lgcc_s := goos == "solaris" -+ if lgcc_s { -+ cgoLDFLAGS = append(cgoLDFLAGS, "-lgcc_s"); -+ } - if err := b.gccld(p, dynobj, cgoLDFLAGS, linkobj); err != nil { - return nil, nil, err - } diff --git a/lang/go/patches/patch-src_net_sendfile__solaris.go b/lang/go/patches/patch-src_net_sendfile__solaris.go new file mode 100644 index 00000000000..ef5f3649a9b --- /dev/null +++ b/lang/go/patches/patch-src_net_sendfile__solaris.go @@ -0,0 +1,17 @@ +$NetBSD: patch-src_net_sendfile__solaris.go,v 1.1 2015/08/25 21:02:52 fhajny Exp $ + +Since sendfile ends up being called in 3rd party software, we need +the library linked here. This fixes building other software that uses +net on SunOS. + +--- src/net/sendfile_solaris.go.orig 2015-08-19 06:05:19.000000000 +0000 ++++ src/net/sendfile_solaris.go +@@ -14,6 +14,8 @@ import ( + //go:cgo_import_dynamic _ _ "libsendfile.so" + //go:cgo_import_dynamic _ _ "libsocket.so" + ++//go:cgo_ldflag "-lsendfile" ++ + // maxSendfileSize is the largest chunk size we ask the kernel to copy + // at a time. + const maxSendfileSize int = 4 << 20 diff --git a/lang/go/patches/patch-src_runtime_cgo_gcc__solaris__amd64.c b/lang/go/patches/patch-src_runtime_cgo_gcc__solaris__amd64.c deleted file mode 100644 index d2ee14fb1e5..00000000000 --- a/lang/go/patches/patch-src_runtime_cgo_gcc__solaris__amd64.c +++ /dev/null @@ -1,80 +0,0 @@ -$NetBSD: patch-src_runtime_cgo_gcc__solaris__amd64.c,v 1.2 2015/08/22 10:51:20 bsiegert Exp $ - -Support cgo on illumos. - ---- src/runtime/cgo/gcc_solaris_amd64.c.orig 2015-07-30 00:03:37.000000000 +0000 -+++ src/runtime/cgo/gcc_solaris_amd64.c -@@ -1,3 +1,73 @@ -+// Copyright 2009 The Go Authors. All rights reserved. -+// Use of this source code is governed by a BSD-style -+// license that can be found in the LICENSE file. -+ -+#include <pthread.h> -+#include <string.h> -+#include <signal.h> -+#include "libcgo.h" -+ -+static void* threadentry(void*); -+static void (*setg_gcc)(void*); -+ -+void -+x_cgo_init(G *g, void (*setg)(void*)) -+{ -+ pthread_attr_t attr; -+ size_t size; -+ -+ setg_gcc = setg; -+ pthread_attr_init(&attr); -+ if (pthread_attr_getstack(&attr, (void **)&g->stacklo, &size) != 0) -+ perror("runtime/cgo: pthread_attr_getstack failed"); -+ g->stackhi = (uintptr_t)g->stacklo + 8192; -+ pthread_attr_destroy(&attr); -+} -+ -+void -+_cgo_sys_thread_start(ThreadStart *ts) -+{ -+ pthread_attr_t attr; -+ sigset_t ign, oset; -+ pthread_t p; -+ size_t size; -+ int err; -+ -+ sigfillset(&ign); -+ pthread_sigmask(SIG_SETMASK, &ign, &oset); -+ -+ pthread_attr_init(&attr); -+ -+ if (pthread_attr_getstack(&attr, (void **)&ts->g->stacklo, &size) != 0) -+ perror("runtime/cgo: pthread_attr_getstack failed"); -+ ts->g->stackhi = (uintptr_t)ts->g->stacklo + 8192; -+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); -+ err = pthread_create(&p, &attr, threadentry, ts); -+ -+ pthread_sigmask(SIG_SETMASK, &oset, nil); -+ -+ if (err != 0) { -+ fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err)); -+ abort(); -+ } -+} -+ -+static void* -+threadentry(void *v) -+{ -+ ThreadStart ts; -+ -+ ts = *(ThreadStart*)v; -+ free(v); -+ -+ /* -+ * Set specific keys. -+ */ -+ setg_gcc((void*)ts.g); -+ -+ crosscall_amd64(ts.fn); -+ return nil; -+} - // Copyright 2015 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. |