On 6 Jun 2016 7:16 PM, Ray Lai <r...@raylai.com> wrote: > > On Mon, 06 Jun 2016 10:43:28 -0400 > "Ted Unangst" <t...@tedunangst.com> wrote: > > I think the first of each of these should be thrkill instead. > > Yup. But I don't know asm asm so I left it as kill(2) for now, which is > arguably better than leaving it as a non-existent syscall.
No, not really - sys_kill and sys_thrkill have different behavior than sys_o58_kill, so you just swap one problem for another. Comments inline - the go-bootstrap port will also need patching. Does this pass make regress? > Beware: I was not an assembly coder 24 hours ago. > > Ray > > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/lang/go/Makefile,v > retrieving revision 1.34 > diff -u -p -r1.34 Makefile > --- Makefile 20 May 2016 16:03:24 -0000 1.34 > +++ Makefile 6 Jun 2016 18:03:22 -0000 > @@ -5,6 +5,7 @@ ONLY_FOR_ARCHS = ${GO_ARCHS} > COMMENT = Go programming language > > VERSION = 1.6.2 > +REVISION = 0 > EXTRACT_SUFX = .src.tar.gz > DISTNAME = go${VERSION} > PKGNAME = go-${VERSION} > Index: patches/patch-src_runtime_sys_openbsd_386_s > =================================================================== > RCS file: /cvs/ports/lang/go/patches/patch-src_runtime_sys_openbsd_386_s,v > retrieving revision 1.1 > diff -u -p -r1.1 patch-src_runtime_sys_openbsd_386_s > --- patches/patch-src_runtime_sys_openbsd_386_s 13 May 2016 13:49:26 -0000 1.1 > +++ patches/patch-src_runtime_sys_openbsd_386_s 6 Jun 2016 18:03:22 -0000 > @@ -1,7 +1,29 @@ > $OpenBSD: patch-src_runtime_sys_openbsd_386_s,v 1.1 2016/05/13 13:49:26 jsing Exp $ > ---- src/runtime/sys_openbsd_386.s.orig Thu May 5 01:27:04 2016 > -+++ src/runtime/sys_openbsd_386.s Thu May 5 01:27:41 2016 > -@@ -214,14 +214,6 @@ TEXT runtime�sigtramp(SB),NOSPLIT,$12 > +--- src/runtime/sys_openbsd_386.s.orig Wed Apr 20 07:50:09 2016 > ++++ src/runtime/sys_openbsd_386.s Tue Jun 7 02:02:23 2016 > +@@ -86,8 +86,11 @@ TEXT runtime�raise(SB),NOSPLIT,$12 > + MOVL AX, 4(SP) // arg 1 - pid This is now tid, not pid. > + MOVL sig+0(FP), AX > + MOVL AX, 8(SP) // arg 2 - signum > +- MOVL $37, AX // sys_kill > ++ MOVL $330, AX // sys___get_tcb > + INT $0x80 > ++ MOVQ AX, DX // arg 3 - tcb TCB is optional, just pass NULL here instead. > ++ MOVL $119, AX // sys_thrkill > ++ INT $0x80 > + RET > + > + TEXT runtime�raiseproc(SB),NOSPLIT,$12 > +@@ -97,7 +100,7 @@ TEXT runtime�raiseproc(SB),NOSPLIT,$12 > + MOVL AX, 4(SP) // arg 1 - pid > + MOVL sig+0(FP), AX > + MOVL AX, 8(SP) // arg 2 - signum > +- MOVL $37, AX // sys_kill > ++ MOVL $122, AX // sys_kill > + INT $0x80 > + RET > + > +@@ -214,14 +217,6 @@ TEXT runtime�sigtramp(SB),NOSPLIT,$12 > MOVL context+8(FP), BX > MOVL BX, 8(SP) > CALL runtime�sigtrampgo(SB) > Index: patches/patch-src_runtime_sys_openbsd_amd64_s > =================================================================== > RCS file: patches/patch-src_runtime_sys_openbsd_amd64_s > diff -N patches/patch-src_runtime_sys_openbsd_amd64_s > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_runtime_sys_openbsd_amd64_s 6 Jun 2016 18:03:22 -0000 > @@ -0,0 +1,25 @@ > +$OpenBSD$ > +--- src/runtime/sys_openbsd_amd64.s.orig Wed Apr 20 07:50:09 2016 > ++++ src/runtime/sys_openbsd_amd64.s Tue Jun 7 01:19:53 2016 > +@@ -158,8 +158,11 @@ TEXT runtime�raise(SB),NOSPLIT,$16 > + SYSCALL > + MOVQ AX, DI // arg 1 - pid As above. > + MOVL sig+0(FP), SI // arg 2 - signum > +- MOVL $37, AX // sys_kill > ++ MOVL $330, AX // sys___get_tcb > + SYSCALL > ++ MOVQ AX, DX // arg 3 - tcb As above. > ++ MOVL $119, AX // sys_thrkill > ++ SYSCALL > + RET > + > + TEXT runtime�raiseproc(SB),NOSPLIT,$16 > +@@ -167,7 +170,7 @@ TEXT runtime�raiseproc(SB),NOSPLIT,$16 > + SYSCALL > + MOVQ AX, DI // arg 1 - pid > + MOVL sig+0(FP), SI // arg 2 - signum > +- MOVL $37, AX // sys_kill > ++ MOVL $122, AX // sys_kill > + SYSCALL > + RET > + > Index: patches/patch-src_runtime_sys_openbsd_arm_s > =================================================================== > RCS file: patches/patch-src_runtime_sys_openbsd_arm_s > diff -N patches/patch-src_runtime_sys_openbsd_arm_s > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_runtime_sys_openbsd_arm_s 6 Jun 2016 18:03:22 -0000 > @@ -0,0 +1,21 @@ > +$OpenBSD$ > +--- src/runtime/sys_openbsd_arm.s.orig Mon Jun 6 14:00:06 2016 > ++++ src/runtime/sys_openbsd_arm.s Mon Jun 6 14:00:25 2016 > +@@ -89,7 +89,7 @@ TEXT runtime�raise(SB),NOSPLIT,$12 > + SWI $0 // sys_getthrid > + // arg 1 - pid, already in R0 > + MOVW sig+0(FP), R1 // arg 2 - signum > +- MOVW $37, R12 // sys_kill > ++ MOVW $122, R12 // sys_kill This needs to be sys_thrkill. > + SWI $0 > + RET > + > +@@ -98,7 +98,7 @@ TEXT runtime�raiseproc(SB),NOSPLIT,$12 > + SWI $0 // sys_getpid > + // arg 1 - pid, already in R0 > + MOVW sig+0(FP), R1 // arg 2 - signum > +- MOVW $37, R12 // sys_kill > ++ MOVW $122, R12 // sys_kill > + SWI $0 > + RET > +