Partial support for no_std in cranelift_codegen#12222
Partial support for no_std in cranelift_codegen#12222alexcrichton merged 63 commits intobytecodealliance:mainfrom
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.
Unsure if this is correct, function always returns 0
There was a problem hiding this comment.
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.
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.
Can you check if I did it correctly?
It just looks a bit wrong, like there has to be a better solution
FYI since I noticed the crosslink, this was released in https://github.com/rust-lang/compiler-builtins/releases/tag/libm-v0.2.16 |
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