Skip to content
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

Clearer linker error due to sjlj ABI mismatch? #23732

Open
hoodmane opened this issue Feb 24, 2025 · 3 comments · May be fixed by #23738
Open

Clearer linker error due to sjlj ABI mismatch? #23732

hoodmane opened this issue Feb 24, 2025 · 3 comments · May be fixed by #23738

Comments

@hoodmane
Copy link
Collaborator

Source file:

#include <setjmp.h>

jmp_buf buf;

int main() {
    longjmp(buf, 8);
}

Compile/link:

$ emcc -c a.c
$ emcc a.o -fwasm-exceptions
error: undefined symbol: emscripten_longjmp (referenced by root reference (e.g. compiled C/C++ code

Would be nice if the error could say something roughly like:

a.o uses setjmp/longjmp but was compiled with incompatible ABI. Pass -fwasm-exceptions as a compile flag.
@anutosh491
Copy link

Thanks for the report. Can try looking into this soon !

sbc100 added a commit to sbc100/emscripten that referenced this issue Feb 24, 2025
Depends on llvm/llvm-project#128564 to allow
wasm-ld to report the object file in question.

Fixes: emscripten-core#23732
@sbc100
Copy link
Collaborator

sbc100 commented Feb 24, 2025

I created an llvm-side fix that (llvm/llvm-project#128564) as well as an emscripten-side fix that should help make this more clear #23738.

@hoodmane
Copy link
Collaborator Author

Thanks for the quick fix @sbc100!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants