Skip to content

LTS: Fix build failure on s390x/musl#13489

Draft
WhyNotHugo wants to merge 1 commit into
bytecodealliance:release-36.0.0from
WhyNotHugo:release-36.0.0-s390x/musl
Draft

LTS: Fix build failure on s390x/musl#13489
WhyNotHugo wants to merge 1 commit into
bytecodealliance:release-36.0.0from
WhyNotHugo:release-36.0.0-s390x/musl

Conversation

@WhyNotHugo
Copy link
Copy Markdown

@WhyNotHugo WhyNotHugo requested a review from a team as a code owner May 26, 2026 23:00
@WhyNotHugo WhyNotHugo requested review from dicej and removed request for a team May 26, 2026 23:00
@alexcrichton alexcrichton requested review from alexcrichton and removed request for dicej May 26, 2026 23:50
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. To confirm, have you run this code and tested it? I ask because the fp in the glibc case does a dereference of the 15th register, but the code here does not do a dereference. That looks like a bug to me, but I wanted to ask. If you haven't tested this I'm personally a bit hesitant to land this because it's generally much more difficult to diagnose these sorts of issues after it lands.

Additionally, do you know the status of exposing the context structures in musl?

And, finally, can you send this PR to the main branch first, and then cherry-pick it for a backport once it's accepted on main? We don't have a ton of precedent here but I think it'd be best to land things on main first and then backport from there.

@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label May 27, 2026
@WhyNotHugo
Copy link
Copy Markdown
Author

We built the downstream Alpine packages with this patch, and https://github.com/open-policy-agent/opa (a dependency of wasmtime) built fine with it and passes all tests.

I was also going to say that all tests passed with this patch, but noticed that tests were actually disabled for the wasmtime package. I enabled them and some tests actually fail even with this patch, so I'll inspect closer and report back.

@WhyNotHugo WhyNotHugo marked this pull request as draft May 27, 2026 14:12
// Register 1 on s390x is the PSW address
pc: (cx.gregs[1] - trap_offset) as usize,
// Register 15 is the frame pointer on s390x
fp: cx.gregs[15] as usize,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for running tests! I think this may be at least one minor issue (it's different from the fp definition above which reads memory). I'm not sure if S390xRegs is the correct definition, as well.

Also, and I'm sorry for lots of comments, but mind renaming S390xRegs to ucontext_t? That matches the intention of the structure where it's matching the C definition of ucontext_t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants