mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: fix syscall9 on darwin/arm64
The aarch64 ABI says that only the first 8 arguments should be passed as registers, subsequent arguments should be put on the stack. Syscall9 is not putting the 9th argument on the stack, and it should. The standard library hasn't hit this issue because it uses Syscall9 for functions that only require 7 or 8 parameters. Change-Id: I1fafca5b16f977ea856e3f08b4ff3d0a2a7a4dfe Reviewed-on: https://go-review.googlesource.com/c/go/+/702297 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
60c1ee9183
commit
7acb0d0446
5 changed files with 197 additions and 5 deletions
28
src/runtime/syscall_test.go
Normal file
28
src/runtime/syscall_test.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2025 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package runtime_test
|
||||
|
||||
import (
|
||||
"internal/testenv"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSyscallArgs(t *testing.T) {
|
||||
if runtime.GOOS != "darwin" {
|
||||
t.Skipf("skipping test: GOARCH=%s", runtime.GOARCH)
|
||||
}
|
||||
testenv.MustHaveCGO(t)
|
||||
|
||||
exe, err := buildTestProg(t, "testsyscall")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := testenv.Command(t, exe)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatalf("test program failed: %v\n%s", err, out)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue