Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Jan 28, 2026

This was written several years ago, and now you don't need to pass -sSUPPORT_LONGJMP=wasm explicitly when you use -fwasm-exceptions. The kind of SjLj support will be determined by the kind of EH support.

But you need a caution when you link C and C++ code together, as noted in #26165.

This was written several years ago, and now you don't need to pass
`-sSUPPORT_LONGJMP=wasm` explicitly when you use `-fwasm-exceptions`.
The kind of SjLj support will be determined by the kind of EH support.

But you need a caution when you link C and C++ code together, as noted
in emscripten-core#26165.
explicitly.

To use the WebAssembly EH and setjmp-longjmp support together:
But you need to pass ``-sSUPPORT_LONGJMP=wasm`` explicitly when you link C and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag is to be used at compile time?
What's the generated code in an object file with SUPPORT_LONGJMP=emscripten?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I clarified the sentence so that it means compile time.

If it's not LTO, the flag you give -sSUPPORT_LONGJMP= determines the kind of SjLj transformation. In LTO, it decides whether +exception-handling will be included in target-features function attribute (which was the reason for #26165)

@aheejin aheejin merged commit f70c029 into emscripten-core:main Jan 30, 2026
36 checks passed
@aheejin aheejin deleted the sjlj_doc branch January 30, 2026 00:49
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 this pull request may close these issues.

2 participants