pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/go14 Backport fixes for compiling under macOS Sie...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/584fe7216608
branches:  trunk
changeset: 353420:584fe7216608
user:      bsiegert <bsiegert%pkgsrc.org@localhost>
date:      Tue Oct 04 18:45:22 2016 +0000

description:
Backport fixes for compiling under macOS Sierra from
https://github.com/golang/go/issues/16352.

diffstat:

 lang/go14/Makefile                                            |   4 +-
 lang/go14/distinfo                                            |   6 +-
 lang/go14/patches/patch-src_runtime_sys__darwin__386.s        |  23 +++++++
 lang/go14/patches/patch-src_runtime_sys__darwin__amd64.s      |  22 ++++++
 lang/go14/patches/patch-src_syscall_syscall__darwin__386.go   |  35 +++++++++++
 lang/go14/patches/patch-src_syscall_syscall__darwin__amd64.go |  35 +++++++++++
 6 files changed, 122 insertions(+), 3 deletions(-)

diffs (166 lines):

diff -r 97bba068f22e -r 584fe7216608 lang/go14/Makefile
--- a/lang/go14/Makefile        Tue Oct 04 17:58:31 2016 +0000
+++ b/lang/go14/Makefile        Tue Oct 04 18:45:22 2016 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.8 2016/07/09 06:38:25 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2016/10/04 18:45:22 bsiegert Exp $
 
 .include "../../lang/go/version.mk"
 
 DISTNAME=      go${GO14_VERSION}.src
 PKGNAME=       go14-${GO14_VERSION}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    lang
 MASTER_SITES=  https://storage.googleapis.com/golang/
 PATCH_SITES=   https://codereview.appspot.com/download/
diff -r 97bba068f22e -r 584fe7216608 lang/go14/distinfo
--- a/lang/go14/distinfo        Tue Oct 04 17:58:31 2016 +0000
+++ b/lang/go14/distinfo        Tue Oct 04 18:45:22 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2016/02/21 14:32:24 bsiegert Exp $
+$NetBSD: distinfo,v 1.7 2016/10/04 18:45:22 bsiegert Exp $
 
 SHA1 (go1.4.3.src.tar.gz) = 486db10dc571a55c8d795365070f66d343458c48
 RMD160 (go1.4.3.src.tar.gz) = b1fbb2805a777c8107e7c946f36a881303ac5e35
@@ -33,5 +33,9 @@
 SHA1 (patch-src_runtime_netpoll__solaris.c) = ae399518bb02d6b898734a52dfa7fe18f041e1ec
 SHA1 (patch-src_runtime_os__solaris.c) = eec5b293fe4a72f58e4cd51cd23ea6e6fce714b6
 SHA1 (patch-src_runtime_os__solaris.h) = c0a39aa6ab57eca7056178c87ebb00bb21236499
+SHA1 (patch-src_runtime_sys__darwin__386.s) = e352e039bba8435a48b88c76290b245731c299ed
+SHA1 (patch-src_runtime_sys__darwin__amd64.s) = 3eccddc8228657db1480393f8476ddd68ac942ff
 SHA1 (patch-src_runtime_sys__solaris__amd64.s) = 88f2e3fc43b0d6e4f17ef06d3f4f27cfed3103c6
 SHA1 (patch-src_runtime_thunk__solaris__amd64.s) = 2835cdc171ae3209c61ef804fbfbf22cdf68bf43
+SHA1 (patch-src_syscall_syscall__darwin__386.go) = 2f0986bdb199feaa73e933a1a75df87e5c7a8bff
+SHA1 (patch-src_syscall_syscall__darwin__amd64.go) = 1bfba4b0f1e2fe6dee55b24f7f8d7cd89d05dea0
diff -r 97bba068f22e -r 584fe7216608 lang/go14/patches/patch-src_runtime_sys__darwin__386.s
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go14/patches/patch-src_runtime_sys__darwin__386.s    Tue Oct 04 18:45:22 2016 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_runtime_sys__darwin__386.s,v 1.1 2016/10/04 18:45:22 bsiegert Exp $
+
+--- src/runtime/sys_darwin_386.s.orig  2016-10-04 18:40:17.000000000 +0000
++++ src/runtime/sys_darwin_386.s
+@@ -182,11 +182,17 @@ timeloop:
+ 
+ systime:
+       // Fall back to system call (usually first call in this thread)
+-      LEAL    12(SP), AX      // must be non-nil, unused
++      LEAL    16(SP), AX      // must be non-nil, unused
+       MOVL    AX, 4(SP)
+       MOVL    $0, 8(SP)       // time zone pointer
++      MOVL    $0, 12(SP)      // required as of Sierra; Issue 16570
+       MOVL    $116, AX
+       INT     $0x80
++      CMPL    AX, $0
++      JNE     inreg
++      MOVL    16(SP), AX
++      MOVL    20(SP), DX
++inreg:
+       // sec is in AX, usec in DX
+       // convert to DX:AX nsec
+       MOVL    DX, BX
diff -r 97bba068f22e -r 584fe7216608 lang/go14/patches/patch-src_runtime_sys__darwin__amd64.s
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go14/patches/patch-src_runtime_sys__darwin__amd64.s  Tue Oct 04 18:45:22 2016 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_runtime_sys__darwin__amd64.s,v 1.1 2016/10/04 18:45:22 bsiegert Exp $
+
+--- src/runtime/sys_darwin_amd64.s.orig        2016-10-04 18:40:17.000000000 +0000
++++ src/runtime/sys_darwin_amd64.s
+@@ -141,10 +141,16 @@ timeloop:
+ 
+ systime:
+       // Fall back to system call (usually first call in this thread).
+-      MOVQ    SP, DI  // must be non-nil, unused
++      MOVQ    SP, DI
+       MOVQ    $0, SI
++      MOVQ    $0, DX  // required as of Sierra; Issue 16570
+       MOVL    $(0x2000000+116), AX
+       SYSCALL
++      CMPQ    AX, $0
++      JNE     inreg
++      MOVQ    0(SP), AX
++      MOVL    8(SP), DX
++inreg:
+       // sec is in AX, usec in DX
+       // return nsec in AX
+       IMULQ   $1000000000, AX
diff -r 97bba068f22e -r 584fe7216608 lang/go14/patches/patch-src_syscall_syscall__darwin__386.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go14/patches/patch-src_syscall_syscall__darwin__386.go       Tue Oct 04 18:45:22 2016 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_syscall_syscall__darwin__386.go,v 1.1 2016/10/04 18:45:22 bsiegert Exp $
+
+Support Mac OS Sierra. https://github.com/golang/go/issues/16352
+
+--- src/syscall/syscall_darwin_386.go.orig     2015-09-23 04:37:37.000000000 +0000
++++ src/syscall/syscall_darwin_386.go
+@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timev
+ }
+ 
+ //sysnb       gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
+-func Gettimeofday(tv *Timeval) (err error) {
+-      // The tv passed to gettimeofday must be non-nil
+-      // but is otherwise unused.  The answers come back
+-      // in the two registers.
++func Gettimeofday(tv *Timeval) error {
++      // The tv passed to gettimeofday must be non-nil.
++      // Before macOS Sierra (10.12), tv was otherwise unused and
++      // the answers came back in the two registers.
++      // As of Sierra, gettimeofday return zeros and populates
++      // tv itself.
+       sec, usec, err := gettimeofday(tv)
+-      tv.Sec = int32(sec)
+-      tv.Usec = int32(usec)
+-      return err
++      if err != nil {
++              return err
++      }
++      if sec != 0 || usec != 0 {
++              tv.Sec = int32(sec)
++              tv.Usec = int32(usec)
++      }
++      return nil
+ }
+ 
+ func SetKevent(k *Kevent_t, fd, mode, flags int) {
diff -r 97bba068f22e -r 584fe7216608 lang/go14/patches/patch-src_syscall_syscall__darwin__amd64.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/go14/patches/patch-src_syscall_syscall__darwin__amd64.go     Tue Oct 04 18:45:22 2016 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_syscall_syscall__darwin__amd64.go,v 1.1 2016/10/04 18:45:22 bsiegert Exp $
+
+Support Mac OS Sierra. https://github.com/golang/go/issues/16352
+
+--- src/syscall/syscall_darwin_amd64.go.orig   2015-09-23 04:37:37.000000000 +0000
++++ src/syscall/syscall_darwin_amd64.go
+@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timev
+ }
+ 
+ //sysnb       gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
+-func Gettimeofday(tv *Timeval) (err error) {
+-      // The tv passed to gettimeofday must be non-nil
+-      // but is otherwise unused.  The answers come back
+-      // in the two registers.
++func Gettimeofday(tv *Timeval) error {
++      // The tv passed to gettimeofday must be non-nil.
++      // Before macOS Sierra (10.12), tv was otherwise unused and
++      // the answers came back in the two registers.
++      // As of Sierra, gettimeofday return zeros and populates
++      // tv itself.
+       sec, usec, err := gettimeofday(tv)
+-      tv.Sec = sec
+-      tv.Usec = usec
+-      return err
++      if err != nil {
++              return err
++      }
++      if sec != 0 || usec != 0 {
++              tv.Sec = sec
++              tv.Usec = usec
++      }
++      return nil
+ }
+ 
+ func SetKevent(k *Kevent_t, fd, mode, flags int) {



Home | Main Index | Thread Index | Old Index