pkgsrc-WIP-changes archive

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

Move over recent patches from lang/go.



Module Name:	pkgsrc-wip
Committed By:	Benny Siegert <bsiegert%gmail.com@localhost>
Pushed By:	bsiegert
Date:		Sun Feb 18 20:17:21 2018 +0100
Changeset:	1def72795882e2bb23883bd95033de5c4d9e030a

Modified Files:
	go/distinfo
Added Files:
	go/patches/patch-src_cmd_dist_util.go
	go/patches/patch-src_cmd_link_internal_ld_elf.go
	go/patches/patch-src_runtime_os__netbsd.go
	go/patches/patch-src_runtime_rt0__netbsd__arm.s

Log Message:
Move over recent patches from lang/go.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1def72795882e2bb23883bd95033de5c4d9e030a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 go/distinfo                                      |  4 ++
 go/patches/patch-src_cmd_dist_util.go            | 16 +++++
 go/patches/patch-src_cmd_link_internal_ld_elf.go | 85 ++++++++++++++++++++++++
 go/patches/patch-src_runtime_os__netbsd.go       | 21 ++++++
 go/patches/patch-src_runtime_rt0__netbsd__arm.s  | 13 ++++
 5 files changed, 139 insertions(+)

diffs:
diff --git a/go/distinfo b/go/distinfo
index 2d511d8b63..b6bf7922da 100644
--- a/go/distinfo
+++ b/go/distinfo
@@ -5,4 +5,8 @@ RMD160 (go1.10.src.tar.gz) = 41c7ea168609e9487fcfbf57daf839d4d77c74f5
 SHA512 (go1.10.src.tar.gz) = 59f089e1ffb2d3aba5ada329d4f0d1181c3c4f01fa64f19d0b753f8a989cb59cf290ad88d215cadc18ef99aba8518e44c9bc258c07eaffc834c55e4a37bd4651
 Size (go1.10.src.tar.gz) = 18300467 bytes
 SHA1 (patch-misc_io_clangwrap.sh) = cd91c47ba0fe7b6eb8009dd261c0c26c7d581c29
+SHA1 (patch-src_cmd_dist_util.go) = 24e6f1b6ded842a8ce322a40e8766f7d344bc47e
+SHA1 (patch-src_cmd_link_internal_ld_elf.go) = acc8d92b7eae1b77470bd3e88af93d458695ac76
 SHA1 (patch-src_crypto_x509_root__bsd.go) = 93a2de7c685a0919fe93f5bc99f156e105dace4d
+SHA1 (patch-src_runtime_os__netbsd.go) = 9b80de94667e3f8d8d1ae3648ab1fe43dd55d577
+SHA1 (patch-src_runtime_rt0__netbsd__arm.s) = 45e727f4e89470505664e7c38bdb8ebd314bcaf5
diff --git a/go/patches/patch-src_cmd_dist_util.go b/go/patches/patch-src_cmd_dist_util.go
new file mode 100644
index 0000000000..0180e91096
--- /dev/null
+++ b/go/patches/patch-src_cmd_dist_util.go
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_cmd_dist_util.go,v 1.1 2018/01/20 16:55:05 christos Exp $
+
+--- src/cmd/dist/util.go.orig	2017-02-16 19:12:22.000000000 +0000
++++ src/cmd/dist/util.go
+@@ -531,6 +531,11 @@ func xgetgoarm() string {
+ 		// sense to auto-detect the setting.
+ 		return "7"
+ 	}
++	if goos == "netbsd" {
++		// NetBSD go/arm support only earmv6hf or earmv7hf now.
++		// Any armv5 (or before) devices cannot work.
++		return "6"
++	}
+ 	if gohostarch != "arm" || goos != gohostos {
+ 		// Conservative default for cross-compilation.
+ 		return "5"
diff --git a/go/patches/patch-src_cmd_link_internal_ld_elf.go b/go/patches/patch-src_cmd_link_internal_ld_elf.go
new file mode 100644
index 0000000000..9def274133
--- /dev/null
+++ b/go/patches/patch-src_cmd_link_internal_ld_elf.go
@@ -0,0 +1,85 @@
+$NetBSD: patch-src_cmd_link_internal_ld_elf.go,v 1.2 2018/01/20 18:13:25 christos Exp $
+
+--- src/cmd/link/internal/ld/elf.go.orig	2017-10-25 14:30:21.000000000 -0400
++++ src/cmd/link/internal/ld/elf.go	2018-01-20 11:49:02.046813855 -0500
+@@ -1263,6 +1263,8 @@
+ 	ELF_NOTE_NETBSD_DESCSZ  = 4
+ 	ELF_NOTE_NETBSD_TAG     = 1
+ 	ELF_NOTE_NETBSD_VERSION = 599000000 /* NetBSD 5.99 */
++	ELF_NOTE_NETBSD_MARCH_NAMESZ = 7
++	ELF_NOTE_NETBSD_MARCH_TAG    = 5
+ )
+ 
+ var ELF_NOTE_NETBSD_NAME = []byte("NetBSD\x00")
+@@ -1272,6 +1274,23 @@
+ 	return elfnote(sh, startva, resoff, n, true)
+ }
+ 
++func elfnetbsdarmarch() []byte {
++	switch objabi.GOARM {
++	case 6:
++		return []byte("earmv6hf\x00")
++	case 7:
++		return []byte("earmv7hf\x00")
++	default:
++		return []byte("earm\x00")
++	}
++}
++
++func elfnetbsdarmsig(sh *ElfShdr, startva uint64, resoff uint64) int {
++	descsz := len(elfnetbsdarmarch())
++	n := int(Rnd(ELF_NOTE_NETBSD_MARCH_NAMESZ, 4) + Rnd(int64(descsz), 4))
++	return elfnote(sh, startva, resoff, n, true)
++}
++
+ func elfwritenetbsdsig() int {
+ 	// Write Elf_Note header.
+ 	sh := elfwritenotehdr(".note.netbsd.ident", ELF_NOTE_NETBSD_NAMESZ, ELF_NOTE_NETBSD_DESCSZ, ELF_NOTE_NETBSD_TAG)
+@@ -1285,7 +1304,20 @@
+ 	Cput(0)
+ 
+ 	Thearch.Lput(ELF_NOTE_NETBSD_VERSION)
+-
++	if SysArch.Family == sys.ARM {
++		mArch := elfnetbsdarmarch()
++		descsz := len(mArch)
++		sh2 := elfwritenotehdr(".note.netbsd.march",
++			ELF_NOTE_NETBSD_MARCH_NAMESZ, uint32(descsz),
++			ELF_NOTE_NETBSD_MARCH_TAG)
++		if sh2 == nil {
++			return 0
++		}
++		Cwrite(ELF_NOTE_NETBSD_NAME)
++		Cput(0)
++		Cwrite(mArch)
++		return int(sh.size) + int(sh2.size)
++	}
+ 	return int(sh.size)
+ }
+ 
+@@ -1902,6 +1934,9 @@
+ 	}
+ 	if Headtype == objabi.Hnetbsd {
+ 		Addstring(shstrtab, ".note.netbsd.ident")
++		if SysArch.Family == sys.ARM {
++			Addstring(shstrtab, ".note.netbsd.march")
++		}
+ 	}
+ 	if Headtype == objabi.Hopenbsd {
+ 		Addstring(shstrtab, ".note.openbsd.ident")
+@@ -2340,6 +2375,15 @@
+ 		pnote.flags = PF_R
+ 		phsh(pnote, sh)
+ 	}
++	if Headtype == objabi.Hnetbsd && SysArch.Family == sys.ARM {
++		var sh *ElfShdr
++		sh = elfshname(".note.netbsd.march")
++		resoff -= int64(elfnetbsdarmsig(sh, uint64(startva), uint64(resoff)))
++		pnote = newElfPhdr()
++		pnote.type_ = PT_NOTE
++		pnote.flags = PF_R
++		phsh(pnote, sh)
++	}
+ 
+ 	if len(buildinfo) > 0 {
+ 		sh := elfshname(".note.gnu.build-id")
diff --git a/go/patches/patch-src_runtime_os__netbsd.go b/go/patches/patch-src_runtime_os__netbsd.go
new file mode 100644
index 0000000000..912b4ee67a
--- /dev/null
+++ b/go/patches/patch-src_runtime_os__netbsd.go
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_runtime_os__netbsd.go,v 1.3 2018/01/20 16:55:05 christos Exp $
+
+--- src/runtime/os_netbsd.go.orig	2017-02-16 19:12:24.000000000 +0000
++++ src/runtime/os_netbsd.go
+@@ -79,13 +79,13 @@ var sigset_all = sigset{[4]uint32{^uint3
+ 
+ // From NetBSD's <sys/sysctl.h>
+ const (
+-	_CTL_HW      = 6
+-	_HW_NCPU     = 3
++	_CTL_HW  = 6
++	_HW_NCPUONLINE = 16
+ 	_HW_PAGESIZE = 7
+ )
+ 
+ func getncpu() int32 {
+-	mib := [2]uint32{_CTL_HW, _HW_NCPU}
++	mib := [2]uint32{_CTL_HW, _HW_NCPUONLINE}
+ 	out := uint32(0)
+ 	nout := unsafe.Sizeof(out)
+ 	ret := sysctl(&mib[0], 2, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
diff --git a/go/patches/patch-src_runtime_rt0__netbsd__arm.s b/go/patches/patch-src_runtime_rt0__netbsd__arm.s
new file mode 100644
index 0000000000..a562c8af40
--- /dev/null
+++ b/go/patches/patch-src_runtime_rt0__netbsd__arm.s
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_runtime_rt0__netbsd__arm.s,v 1.1 2018/01/20 16:55:05 christos Exp $
+
+--- src/runtime/rt0_netbsd_arm.s.orig	2017-02-16 19:12:24.000000000 +0000
++++ src/runtime/rt0_netbsd_arm.s
+@@ -9,3 +9,8 @@ TEXT _rt0_arm_netbsd(SB),NOSPLIT,$-4
+ 	MOVW	$4(R13), R1		// argv
+ 	MOVM.DB.W [R0-R1], (R13)
+ 	B runtime·rt0_go(SB)
++
++TEXT main(SB),NOSPLIT,$-4
++	MOVM.DB.W [R0-R1], (R13)
++	MOVW	$runtime·rt0_go(SB), R4
++	B	(R4)


Home | Main Index | Thread Index | Old Index