Open
Conversation
Contributor
Author
e4a96d1 to
5b812ca
Compare
ezrosent
requested changes
Sep 23, 2025
Owner
ezrosent
left a comment
There was a problem hiding this comment.
Thanks for this change (and the others!)
Left some minor comments then I think they're good to merge.
5b812ca to
69be3d0
Compare
Update Cranelift to 0.123.2:
- `is_pic` option needs to be false for jit from Cranelift 0.122.0:
bytecodealliance/wasmtime#2735
- `declare_var(type)` will now return a new variable entity and
the variable does not need to be created first anymore:
bytecodealliance/wasmtime@8236a07
…odegen::intrinsics" Never inline `pub(crate) unsafe extern "C"` functions from "codegen::intrinsics" as this can give different addresses for the same function when the address is requested in "codegen::intrinsics" or in "codegen::clif". Especially mathematical `_frawk_*` functions can have this issue as they are very small. For example the address of `_frawk_sin` function when calling `register_all` and `external!(_frawk_sin)` in codegen::clif" was different when the function gets inlined, and `call_inst` would fail with the address given by `external!(_frawk_sin)` in codegen::clif".
Replace `mem:transmute` in `wrap_args` with safer options as without it:
$ frawk -Bcranelift 'BEGIN { printf("%d\t%f\t%s\n", integer, float, string); }'
would crash with:
failure in runtime invalid type code passed to printf_impl_file: 2. Halting execution
or with `invalid opcode` after cranelift update.
Fixes: ezrosent#121
69be3d0 to
114e587
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update Cranelift to 0.123.2:
is_picoption needs to be false for jit from Cranelift 0.122.0:Support PLT entries in
cranelift-jitcrate on aarch64 bytecodealliance/wasmtime#2735declare_var(type)will now return a new variable entity andthe variable does not need to be created first anymore:
bytecodealliance/wasmtime@8236a07
Never inlining
pub(crate) unsafe extern "C"functions from "codegen::intrinsics"as this can give different addresses for the same function when the address is
requested in "codegen::intrinsics" or "codegen::clif".
Expecially mathematical
_frawk_*functions can have this issue.For example the address of
_frawk_sinfunction when callingregister_alland
external!(_frawk_sin)in codegen::clif" was different when the functionget inlined, and
call_instwould fail with the address given byexternal!(_frawk_sin)in codegen::clif".Replace
mem:transmuteinwrap_argswith safer optionsWithout it:
would crash with:
or with
invalid opcodeafter cranelift update.Fixes: #121