signal: add SignalMap for linux/sparc64 - #249
Open
shalseth wants to merge 1 commit into
Open
Conversation
SPARC has no SIGSTKFLT, so x/sys/unix does not define it for sparc64 and the "STKFLT" entry in signal_linux.go does not compile there. SPARC uses SIGEMT in that slot, as the mips architectures do. Add signal_linux_sparc64.go and exclude sparc64 from signal_linux.go, following signal_linux_mipsx.go. The new file is that one with the build tag changed and sigrtmax set to 64 rather than 127, which leaves sigrtmin and sigrtmax matching the generic file, so the SIGSTKFLT/SIGEMT swap is the only substantive difference. One thing is still missing before the package builds on linux/sparc64: x/sys/unix has no syscall implementation for that architecture. That is a separate matter, being pursued upstream. This change was checked against a tree that has one, where the package's tests pass on an UltraSPARC T4-1. Signed-off-by: Stian Halseth <stian@itx.no>
kolyshkin
requested changes
Aug 28, 2026
kolyshkin
left a comment
Collaborator
There was a problem hiding this comment.
I think we should put this on hold until x/sys/unix implements linux/sparc64 syscalls.
shalseth
added a commit
to shalseth/sys
that referenced
this pull request
Aug 28, 2026
syscall_unix_gc.go and syscall_linux_gc.go declare Syscall, Syscall6, RawSyscall, RawSyscall6, SyscallNoError and RawSyscallNoError for every gc-built unix target, with the bodies supplied per architecture in assembly. linux/sparc64 has the generated syscall, errno, sysnum and type files and a hand-written syscall_linux_sparc64.go, but no asm_linux_sparc64.s, so the package does not compile there at all, and neither does anything importing it. Add the file in the same shape as the other linux architectures: jump to package syscall's implementations where they exist, and trap directly for the two NoError variants. On SPARC the trap is ta 0x6d, with the syscall number in %g1 and the arguments in %o0-%o5. linux/mkall.go already lists sparc64, noting that it is "not fully supported, but there is enough support already to generate Go type and error definitions". This is the piece that makes that support reachable rather than inert. It is wanted downstream as well: moby/sys#249 adds a sparc64 signal map and was put on hold by its maintainer pending "x/sys/unix implements linux/sparc64 syscalls". Built and tested on an UltraSPARC T4-1 running linux/sparc64 with a gc toolchain that supports the architecture. The package compiles, and being able to run its test suite is what turned up the two bugs fixed in CL 822904 and CL 822906, which account for every failure it shows here bar one that is specific to my kernel build. Updates golang/go#55000
Author
Agreed, posted now on golang/sys#292. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SPARC has no SIGSTKFLT, so x/sys/unix does not define it for sparc64 and the "STKFLT" entry in signal_linux.go does not compile there. SPARC uses SIGEMT in that slot, as the mips architectures do.
Add signal_linux_sparc64.go and exclude sparc64 from signal_linux.go, following signal_linux_mipsx.go. The new file is that one with the build tag changed and sigrtmax set to 64 rather than 127, which leaves sigrtmin and sigrtmax matching the generic file, so the SIGSTKFLT/SIGEMT swap is the only substantive difference.
One thing is still missing before the package builds on linux/sparc64: x/sys/unix has no syscall implementation for that architecture. That is a separate matter, being pursued upstream. This change was checked against a tree that has one, where the package's tests pass on an UltraSPARC T4-1.