-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cranelift-codegen fails to compile without x86 support #1240
Comments
This is now biting us in Spidermonkey too, where we only build the relevant backends, so this is high priority for us. We could add supplementary builds with disabled features in automation, to make sure they don't get broken anymore. |
I initially tried adding
Yes and yes, I think.
How would that signature get assigned to the instruction? It is not possible to lower the instructions to libcalls, as they require a very specific combination of x86 instructions for the linker to handle it correctly.
During compilation the build script detects the current architecture and automatically enables support for it. (at least if there are no archs enabled through feature flags) |
So my current thinking is the following: since this can't be emulated properly with a call, maybe the proper way here is to add a new accessor on the opcode? I've got a wip patch that does this, with a new property called "clobbers_all_regs", and which is tested during register allocation in place of the opcode comparisons. I thought about other names, like "emulates_call", but this seems to be the most explicit, at the very least. |
👍 |
Was actually working on the same, but named it |
…pcode requires spilling all registers;
…pcode requires spilling all registers;
…pcode requires spilling all registers;
cranelift-codegen
targeting only one architecture (as an example, clone https://github.com/iximeow/cautious-pancake and build it)3179dcf
(master
)This was first mentioned by @stefson in this comment.
I agree with @bjorn3's assessment in reply. Since TLS access assumes a C ABI, would it make sense to just add
is_call
as an attribute to these opcodes? Edit: this depends on other questions like, canTlsGetAddr
be hoisted in LICM? Eligible for DCE? And interaction with the verifier? Given that it includes a call I think this might be the right way to go about it. And since the call takes an argument in rdi, if there needs to be a signature for verifier reasons, it looks like we can synthesize one of the form(rdi) -> rax
?A wider concern: does anyone have ideas on how we'd build Cranelift under these different, more specific, feature flag combinations? I was surprised to learn
cargo build --no-default-features --features std
didn't work to show this, but that seems to be a consequence of this issue. It seems appropriate to have some test crates that build under feature flag combinations we want to support, so issues like this get caught in CI. It would raise build times a bit, but I'm not sure how much. Does that sound acceptable?The text was updated successfully, but these errors were encountered: