-
Notifications
You must be signed in to change notification settings - Fork 41
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
PowerPC: regs member in uc_mcontext #36
Comments
On musl, libucontext uses the musl headers for structure definitions. So we should probably ask dalias. |
(I would assume the issue is that _GNU_SOURCE needs to be defined though) |
https://git.musl-libc.org/cgit/musl/commit/?id=c2518a8efb6507f1b41c3b12e03b06f8f2317a1f I suppose libucontext could provide a definition of |
I think pt_regs should come from kernel, but i’m not sure what header has it. |
Seems to be defined in Would it be possible to include this Linux header from |
As the headers from musl are used on musl, I don’t have any control over them. You could include asm/ptrace.h in the GCC-Go side of things though. |
I looked into how glibc handles this. Similar to musl, glibc also seem to declare |
… 32-bit arm' (#36) from rlcamp/libucontext:arm_linker_fix into master Reviewed-on: https://gitea.treehouse.systems/ariadne/libucontext/pulls/36
I am currently using libcontext with gcc-go, which uses ucontext functions to implement goroutines. In this regard, I am trying to reduce the amount of gcc-go patches required to make it work on musl systems. On the PowerPC architecture, libgo from gcc-go assumes a
regs
member to be present in the machine-specific representation of the saved context (uc_mcontext
):Unfortunately, this
regs
member does not seem to be available on libucontext, thus requiring patching gcc-go. However, libucontext seems to expose the same registers via thegp_regs
member. For example,uc_mcontext.regs->nip
seems to be accessible with libucontext asuc_mcontext.gp_regs[REG_NIP]
.I am not an expert on ucontext and it is presently unclear to me where the
uc_mcontext
fields are standardized (since POSIX does not seem to mandate those) but I am wondering if it would be possible to add theregs
member touc_mcontext
on PowerPC to make existing code (i.e. gcc-go) work without additional patches.The text was updated successfully, but these errors were encountered: