-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Partial support for no_std in cranelift_codegen #12222
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
Conversation
b9ba25d to
273766f
Compare
794b29b to
57f8847
Compare
|
I've removed OnceLock, but MachineEnv is now recomputed each time. |
|
|
dcc9b06 to
cea863f
Compare
| let slot_offset = self.abi.get_spillslot_offset(slot); | ||
| let slot_base_to_caller_sp_offset = self.abi.slot_base_to_caller_sp_offset(); | ||
| #[cfg(not(feature = "unwind"))] | ||
| let caller_sp_to_cfa_offset = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure if this is correct, function always returns 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @cfallin should this perhaps continue to skip this value? Or panic! since this should be unreachable? Or is 0 ok to leave in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if we don't have unwind then we don't have the appropriate metadata to allow a native debugger to interpret frames anyway, so we should continue. I'm a bit curious how this built in a non-unwind build before -- or was that broken because std always enabled unwind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@the-ssd OK, yep, let's do a continue in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if I did it correctly?
It just looks a bit wrong, like there has to be a better solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Used to close #1158, allows for cranelift to be used in a no_std environment, like a kernel.
There is already #9007, which stalled.
And I am at a point I think it makes sense to ask someone what do you want to be done about FxHashMap and OnceLock. There are alternative crates that implement it, like this one (also has a comparison chart).
What is left to do:
libm::Libm::roundevenrust-lang/compiler-builtins#1053, so a hack is used, waiting for libm to be published to crates.io