pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/lang/go
Module Name: pkgsrc
Committed By: christos
Date: Sat Jan 20 16:55:06 UTC 2018
Modified Files:
pkgsrc/lang/go: Makefile PLIST distinfo version.mk
Added Files:
pkgsrc/lang/go/patches: patch-src_cmd_dist_util.go
patch-src_cmd_link_internal_ld_elf.go
patch-src_runtime_os__netbsd.go
patch-src_runtime_rt0__netbsd__arm.s
Log Message:
Add Yasushi Oshima patches for arm from:
https://github.com/oshimaya/pkgsrc/tree/master/lang/go
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 pkgsrc/lang/go/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/go/PLIST
cvs rdiff -u -r1.53 -r1.54 pkgsrc/lang/go/distinfo
cvs rdiff -u -r1.30 -r1.31 pkgsrc/lang/go/version.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/go/patches/patch-src_cmd_dist_util.go \
pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go \
pkgsrc/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s
cvs rdiff -u -r0 -r1.3 pkgsrc/lang/go/patches/patch-src_runtime_os__netbsd.go
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/lang/go/Makefile
diff -u pkgsrc/lang/go/Makefile:1.58 pkgsrc/lang/go/Makefile:1.59
--- pkgsrc/lang/go/Makefile:1.58 Tue Nov 14 04:53:53 2017
+++ pkgsrc/lang/go/Makefile Sat Jan 20 11:55:05 2018
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.58 2017/11/14 09:53:53 wiz Exp $
+# $NetBSD: Makefile,v 1.59 2018/01/20 16:55:05 christos Exp $
.include "version.mk"
DISTNAME= go${GO_VERSION}.src
PKGNAME= go-${GO_VERSION}
+PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= https://storage.googleapis.com/golang/
EXTRACT_USING= bsdtar
@@ -37,6 +38,7 @@ REPLACE_BASH+= misc/cgo/testcshared/test
REPLACE_BASH+= misc/cgo/testgodefs/test.bash
REPLACE_BASH+= misc/cgo/testplugin/test.bash
REPLACE_BASH+= misc/cgo/testsanitizers/test.bash
+REPLACE_BASH+= misc/cgo/testplugin/test.bash
REPLACE_BASH+= misc/nacl/go_nacl_386_exec
REPLACE_BASH+= misc/nacl/go_nacl_amd64p32_exec
REPLACE_BASH+= misc/nacl/go_nacl_arm_exec
@@ -92,9 +94,9 @@ PLIST.route= yes
.endif
do-build:
- cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} ${BASH} ./make.bash
+ cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} ${GOOPT} ${BASH} ./make.bash
# for RELRO build:
-# cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${BASH} ./make.bash
+# cd ${WRKSRC}/src && env GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:Q} GOROOT_FINAL=${GOROOT_FINAL:Q} GO_LDFLAGS="-buildmode=pie" ${GOOPT} ${BASH} ./make.bash
do-install:
cd ${WRKSRC} && rm -rf .hgignore .hgtags pkg/obj
@@ -105,6 +107,6 @@ do-install:
.endfor
do-test:
- cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${BASH} run.bash --no-rebuild --banner ""
+ cd ${WRKSRC}/src && GOROOT=${WRKSRC} PATH=${WRKSRC}/bin:${PATH} ${GOOPT} ${BASH} run.bash --no-rebuild --banner ""
.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/lang/go/PLIST
diff -u pkgsrc/lang/go/PLIST:1.34 pkgsrc/lang/go/PLIST:1.35
--- pkgsrc/lang/go/PLIST:1.34 Sat Oct 28 14:20:14 2017
+++ pkgsrc/lang/go/PLIST Sat Jan 20 11:55:05 2018
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.34 2017/10/28 18:20:14 bsiegert Exp $
+@comment $NetBSD: PLIST,v 1.35 2018/01/20 16:55:05 christos Exp $
bin/go
bin/gofmt
go/AUTHORS
@@ -4584,6 +4584,7 @@ go/src/runtime/crash_nonunix_test.go
go/src/runtime/crash_test.go
go/src/runtime/crash_unix_test.go
go/src/runtime/debug.go
+go/src/runtime/debug_netbsd.go
go/src/runtime/debug/debug.s
go/src/runtime/debug/garbage.go
go/src/runtime/debug/garbage_test.go
Index: pkgsrc/lang/go/distinfo
diff -u pkgsrc/lang/go/distinfo:1.53 pkgsrc/lang/go/distinfo:1.54
--- pkgsrc/lang/go/distinfo:1.53 Sat Oct 28 14:20:14 2017
+++ pkgsrc/lang/go/distinfo Sat Jan 20 11:55:05 2018
@@ -1,8 +1,12 @@
-$NetBSD: distinfo,v 1.53 2017/10/28 18:20:14 bsiegert Exp $
+$NetBSD: distinfo,v 1.54 2018/01/20 16:55:05 christos Exp $
SHA1 (go1.9.2.src.tar.gz) = 8a51dbdf51d6ee0e058b7de7c7606dbea23dfeec
RMD160 (go1.9.2.src.tar.gz) = f8ae6b41af3f450b0d9a3d33aa9e0d5df39904d4
SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5
Size (go1.9.2.src.tar.gz) = 16383591 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) = 290d0da125d4f1956e05ac98cddf09f465c344df
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
Index: pkgsrc/lang/go/version.mk
diff -u pkgsrc/lang/go/version.mk:1.30 pkgsrc/lang/go/version.mk:1.31
--- pkgsrc/lang/go/version.mk:1.30 Sat Oct 28 14:20:14 2017
+++ pkgsrc/lang/go/version.mk Sat Jan 20 11:55:05 2018
@@ -1,11 +1,11 @@
-# $NetBSD: version.mk,v 1.30 2017/10/28 18:20:14 bsiegert Exp $
+# $NetBSD: version.mk,v 1.31 2018/01/20 16:55:05 christos Exp $
.include "../../mk/bsd.prefs.mk"
GO_VERSION= 1.9.2
GO14_VERSION= 1.4.3
-ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-*arm*
+ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf
NOT_FOR_PLATFORM= SunOS-*-i386
.if ${MACHINE_ARCH} == "i386"
GOARCH= 386
@@ -13,9 +13,14 @@ GOCHAR= 8
.elif ${MACHINE_ARCH} == "x86_64"
GOARCH= amd64
GOCHAR= 6
-.elif !empty(MACHINE_ARCH:M*arm*)
+.elif ${MACHINE_ARCH} == "earmv6hf" || ${MACHINE_ARCH} == "earmv7hf"
GOARCH= arm
GOCHAR= 5
.endif
+.if ${MACHINE_ARCH} == "earmv6hf"
+GOOPT= GOARM=6
+.elif ${MACHINE_ARCH} == "earmv7hf"
+GOOPT= GOARM=7
+.endif
PLIST_SUBST+= GO_PLATFORM=${LOWER_OPSYS:Q}_${GOARCH:Q} GOARCH=${GOARCH:Q}
PLIST_SUBST+= GOCHAR=${GOCHAR:Q}
Added files:
Index: pkgsrc/lang/go/patches/patch-src_cmd_dist_util.go
diff -u /dev/null pkgsrc/lang/go/patches/patch-src_cmd_dist_util.go:1.1
--- /dev/null Sat Jan 20 11:55:06 2018
+++ pkgsrc/lang/go/patches/patch-src_cmd_dist_util.go Sat Jan 20 11:55:05 2018
@@ -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"
Index: pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go
diff -u /dev/null pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go:1.1
--- /dev/null Sat Jan 20 11:55:06 2018
+++ pkgsrc/lang/go/patches/patch-src_cmd_link_internal_ld_elf.go Sat Jan 20 11:55:05 2018
@@ -0,0 +1,85 @@
+$NetBSD: patch-src_cmd_link_internal_ld_elf.go,v 1.1 2018/01/20 16:55:05 christos Exp $
+
+--- elf.go.orig 2017-10-25 14:30:21.000000000 -0400
++++ 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")
Index: pkgsrc/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s
diff -u /dev/null pkgsrc/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s:1.1
--- /dev/null Sat Jan 20 11:55:06 2018
+++ pkgsrc/lang/go/patches/patch-src_runtime_rt0__netbsd__arm.s Sat Jan 20 11:55:05 2018
@@ -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)
Index: pkgsrc/lang/go/patches/patch-src_runtime_os__netbsd.go
diff -u /dev/null pkgsrc/lang/go/patches/patch-src_runtime_os__netbsd.go:1.3
--- /dev/null Sat Jan 20 11:55:06 2018
+++ pkgsrc/lang/go/patches/patch-src_runtime_os__netbsd.go Sat Jan 20 11:55:05 2018
@@ -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)
Home |
Main Index |
Thread Index |
Old Index