]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix sysctl calling convention on netbsd/386
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 29 Nov 2017 06:36:42 +0000 (06:36 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 29 Nov 2017 16:24:04 +0000 (16:24 +0000)
Thanks to coypoop for noticing at:

  https://github.com/golang/go/issues/22914#issuecomment-347761838

FreeBSD/386 and NetBSD/386 diverged between Go 1.4 and Go 1.5 when
Russ sent https://golang.org/cl/135830043 (git rev 25f6b02ab0db8e)
to change the calling convention of the C compilers to match Go.
But netbsd wasn't updated.

Tested on a NetBSD/386 VM, since the builders aren't back up yet (due
to this bug)

Fixes #22914
Updates #19339
Updates #20852
Updates #16511

Change-Id: Id76ebe8f29bcc85e39b1c11090639d906cd6cf04
Reviewed-on: https://go-review.googlesource.com/80515
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/sys_netbsd_386.s

index af8c3aa4859bb27c518dec350f518fc8a9d9d702..8ee7b96ce7d70fa80a173cb0cc0f514caf6e77c1 100644 (file)
@@ -375,10 +375,12 @@ TEXT runtime·sysctl(SB),NOSPLIT,$28
        MOVSL                           // arg 6 - newlen
        MOVL    $202, AX                // sys___sysctl
        INT     $0x80
-       JCC     3(PC)
+       JAE     4(PC)
        NEGL    AX
+       MOVL    AX, ret+24(FP)
        RET
        MOVL    $0, AX
+       MOVL    AX, ret+24(FP)
        RET
 
 GLOBL runtime·tlsoffset(SB),NOPTR,$4