-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall, runtime: New ABI separation breaks //go:linkname #28769
Comments
Ah, sorry I missed internal/syscall. We probably just need to add that to
the list of known cross-package references in cmd/go. I'll send a patch in
a little bit.
|
@Helflym, could you try this patch? If this works, I'll mail a CL. Thanks! diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go
index 89ef2da8cb..a360a1f620 100644
--- a/src/cmd/go/internal/work/gc.go
+++ b/src/cmd/go/internal/work/gc.go
@@ -297,7 +297,7 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro
if p.ImportPath == "runtime" {
// Assembly in syscall and runtime/cgo references
// symbols in runtime.
- otherPkgs = []string{"syscall", "runtime/cgo"}
+ otherPkgs = []string{"syscall", "internal/syscall", "runtime/cgo"}
} else if p.ImportPath == "runtime/internal/atomic" {
// sync/atomic is an assembly wrapper around
// runtime/internal/atomic. |
It needs to be "internal/syscall/unix". Otherwise, it doesn't work. |
Change https://golang.org/cl/149817 mentions this issue: |
@aclements I've the same problem with x/sys/unix which has a jmp to syscall.rawSyscall6.
Do you want to add it as another cross-package ? Or do I need to remove the linkname which will remove further problems like this one ? Edit: I've submitted https://go-review.googlesource.com/c/go/+/153997 which should remove definitely this issue, as syscall.Syscall6 might be called from any packages. |
Change https://golang.org/cl/153997 mentions this issue: |
Replaces //go:linkname by assembly functions for syscall functions on aix/ppc64. Since the new runtime internal ABI, this was triggering an error if syscall.Syscall6 was called by others packages like x/sys/unix. This commit should remove every future occurences of this problem. Fixes #28769 Change-Id: I6a4bf77472ee1e974bdb76b27e74275e568f5a76 Reviewed-on: https://go-review.googlesource.com/c/153997 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
What version of Go are you using (
go version
)?go version devel +e092e96d4e Tue Nov 13 13:47:34 2018 -0600 aix/ppc64
after 685aca4 + few AIX commits not yet pushed.
Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (
go env
)?aix/ppc64
What did you do?
The new ABI separation seems to break relocations linked with some //go:linkname between syscall functions and their runtime implementation:
Here is what triggers the fault:
internal/syscall/unix/asm_aix_ppc64.s:
syscall/syscall_aix.go:
runtime/syscall_aix.go:
Note that creating a JMP in syscall/asm_aix_ppc64.s instead of a //go:linkname fixes it:
Is it indented to avoid ABI bypass or something like this ? Or just a bug ?
@aclements
The text was updated successfully, but these errors were encountered: