-
Notifications
You must be signed in to change notification settings - Fork 3.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
side module calls main module with a 64bit param #8291
Conversation
…it param with legalization off
} | ||
|
||
void callPassBigInt(){ | ||
passBigInt(1152921504606846975); |
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.
I think we expect that this would get translated into a call_indirect, but this gets translated into a $env._passBigInt instead.
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 indirection here is handled on the JS side. The imported function is a JS stub that gets filled in as symbols are resolved by loading modules.
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.
right and this JS stub is causing problems when we turn off JS legalization.
args = ['-s', 'LEGALIZE_JS_FFI=0', '-s', 'SIDE_MODULE=1', '-O3', '-s', 'DISABLE_EXCEPTION_CATCHING=0'] | ||
print(args) | ||
cmd = [PYTHON, EMCC, path_from_root('tests', 'other', 'noffi-side.cpp'), '-g', '-o', 'side.wasm'] + args | ||
print(' '.join(cmd)) |
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.
I do see this fail in the node command, with function signature mismatch
- but this emcc command is never executed here. So side.wasm
does not exist. Is that the cause of the problem?
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.
@kripken sorry about that. i have pushed a fix to the test so it fails properly now. the error is
exception thrown: TypeError: invalid type,TypeError: invalid type
Thanks, now I think I see what's going on here. In src/support.js, in our dynamic loader code we create a JS indirection for calls between wasm modules. That indirection helps with circular dependencies (adding an import to a wasm module not yet loaded). But it will fail on JS not being able to handle a wasm type. As a fix, we'd need either BigInts in JS, or to implement the new dynamic loading idea we've discussed in #8268 |
The deletion of the Re-opening and re-targeting to master. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
related to Make js library functions compatible with LEGALIZE_JS_FFI=0 #7679