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
[emscripten-finalize] longjmp rewriter fails to update GOT #2180
Comments
@sbc100 do you have time to look at this? if not I can, but I could use some direction (testcase would be good) |
Ah yes, it should re-write them both. I'll take a look. Do you know why we haven't seen this is test code? What are we missing that we need to add that will tickle this? |
Presumably this should just trigger on any code compiled with |
Or |
@sbc100 @kripken Here's a repro (extracted from this test) with emscripten #include <setjmp.h>
#include <stdio.h>
typedef struct {
jmp_buf* jmp;
} jmp_state;
void setjmp_func(jmp_state* s, int level) {
jmp_buf* prev_jmp = s->jmp;
jmp_buf c_jmp;
if (level == 2) {
longjmp(*(s->jmp), 1);
}
if (setjmp(c_jmp) == 0) {
setjmp_func(s, level + 1);
}
}
int main() { return 0; } Note the code in itself does not make sense, I removed everything I could up to the breaking point. It's built with:
I cannot build Skia (canvaskit) as a side module as result of this issue, hope this will help! |
Now that we have landed (for the third time) the binaryen fix for WebAssembly/binaryen#2180 we can once again allow `-fPIC` at compile time as an alternative to MAIN_MODULE or SIDE_MODULE. This reverts commit 19a9e35.
Now that we have landed (for the third time) the binaryen fix for WebAssembly/binaryen#2180 we can once again allow `-fPIC` at compile time as an alternative to MAIN_MODULE or SIDE_MODULE. This reverts commit 19a9e35.
The
fixInvokeFunctionNames
pass in emscripten-finalize rewrites the function and import foremscripten_longjmp_jmpbuf
toemscripten_longjmp
, but doesn't do anything to any potential GOT entries that may be present in the module. This causes a fatal error later in the same utility:The text was updated successfully, but these errors were encountered: